summaryrefslogtreecommitdiff
path: root/examples/test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/test.ts')
-rw-r--r--examples/test.ts20
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);
+});