diff options
| -rw-r--r-- | testing/README.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/testing/README.md b/testing/README.md new file mode 100644 index 000000000..919b1279b --- /dev/null +++ b/testing/README.md @@ -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"}); +}); +```
\ No newline at end of file |
