mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
parent
8d682b4d49
commit
4dd52719de
1 changed files with 31 additions and 0 deletions
31
testing/README.md
Normal file
31
testing/README.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Testing
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { test, assert, equal, assertEqual } from 'https://deno.land/x/testing/testing.ts';
|
||||
|
||||
test({
|
||||
name: 'testing example',
|
||||
fn() {
|
||||
assert(equal("world", "world"));
|
||||
assert(!equal("hello", "world"));
|
||||
assert(equal({ hello: "world" }, { hello: "world" }));
|
||||
assert(!equal({ world: "hello" }, { hello: "world" }));
|
||||
assertEqual("world", "world");
|
||||
assertEqual({hello: "world"}, {hello: "world"});
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Short syntax (named function instead of object):
|
||||
```ts
|
||||
test(function example() {
|
||||
assert(equal("world", "world"));
|
||||
assert(!equal("hello", "world"));
|
||||
assert(equal({ hello: "world" }, { hello: "world" }));
|
||||
assert(!equal({ world: "hello" }, { hello: "world" }));
|
||||
assertEqual("world", "world");
|
||||
assertEqual({hello: "world"}, {hello: "world"});
|
||||
});
|
||||
```
|
Loading…
Reference in a new issue