summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/README.md18
1 files changed, 12 insertions, 6 deletions
diff --git a/testing/README.md b/testing/README.md
index f9f47eaa6..70968e3c7 100644
--- a/testing/README.md
+++ b/testing/README.md
@@ -1,24 +1,30 @@
-# Testing
+# Testing
## Usage
```ts
-import { test, assert, equal, assertEqual } from 'https://deno.land/x/testing/mod.ts';
+import {
+ test,
+ assert,
+ equal,
+ assertEqual
+} from "https://deno.land/x/testing/mod.ts";
test({
- name: 'testing example',
+ 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"});
- },
+ assertEqual({ hello: "world" }, { hello: "world" });
+ }
});
```
Short syntax (named function instead of object):
+
```ts
test(function example() {
assert(equal("world", "world"));
@@ -26,6 +32,6 @@ test(function example() {
assert(equal({ hello: "world" }, { hello: "world" }));
assert(!equal({ world: "hello" }, { hello: "world" }));
assertEqual("world", "world");
- assertEqual({hello: "world"}, {hello: "world"});
+ assertEqual({ hello: "world" }, { hello: "world" });
});
```