summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasashi Hirano <shisama07@gmail.com>2019-01-04 04:16:15 +0900
committerRyan Dahl <ry@tinyclouds.org>2019-01-03 14:16:15 -0500
commit4dd52719dee4281228c618dd13eae49ea7d04ff7 (patch)
tree8d8574c886d0764d259b8ffa9642f8faf753c39d
parent8d682b4d49672d5a930ceaeae5f35e9f332f3bf8 (diff)
Add testing/README.md (denoland/deno_std#75)
Original: https://github.com/denoland/deno_std/commit/9552f28daf5e9bc77e0ace4032c93e538ef1f9f5
-rw-r--r--testing/README.md31
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