mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
Add testing/README.md (#75)
This commit is contained in:
parent
2d9a9cdfd1
commit
9552f28daf
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 New Issue
Block a user