summaryrefslogtreecommitdiff
path: root/testing/README.md
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-01-06 14:19:15 -0500
committerGitHub <noreply@github.com>2019-01-06 14:19:15 -0500
commitc164e696d7f924fe785421058d834934b7014429 (patch)
tree90af4dd0f6f5bd2e3149c8af1f8fc8b1247d03dc /testing/README.md
parent68584f983e4b1cf81d84cdb57bb5459127293cd2 (diff)
Fix format globs (denoland/deno_std#87)
Original: https://github.com/denoland/deno_std/commit/297cf0975eca194a677e6fadd7d753d62eb453c3
Diffstat (limited to 'testing/README.md')
-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" });
});
```