diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-12-19 13:50:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-19 13:50:48 -0500 |
commit | 3542f2de0cecdbcf07d3bea3de6439e6a87376df (patch) | |
tree | 53c39ae3456fa8d6a360485378e8d82949b09e9a /examples/test.ts | |
parent | ecde6a4c503584aa712f40e70c8e1aa78959e110 (diff) |
Add examples/ directory (denoland/deno_std#28)
Previously https://github.com/denoland/deno_examples
Original: https://github.com/denoland/deno_std/commit/14be9a0e82d1b54d5b0f04291d9154d1d7da29f7
Diffstat (limited to 'examples/test.ts')
-rw-r--r-- | examples/test.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/test.ts b/examples/test.ts new file mode 100644 index 000000000..4d2dea157 --- /dev/null +++ b/examples/test.ts @@ -0,0 +1,20 @@ +import { run } from "deno"; +import { test, assertEqual } from "https://deno.land/x/testing/testing.ts"; + +/** Example of how to do basic tests */ +test(function t1() { + assertEqual("hello", "hello"); +}); + +test(function t2() { + assertEqual("world", "world"); +}); + +/** A more complicated test that runs a subprocess. */ +test(async function catSmoke() { + const p = run({ + args: ["deno", "examples/cat.ts", "README.md"] + }); + const s = await p.status(); + assertEqual(s.code, 0); +}); |