2020-01-02 15:13:47 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2019-03-06 19:42:24 -05:00
|
|
|
import { assertEquals } from "../testing/asserts.ts";
|
2018-12-19 13:50:48 -05:00
|
|
|
|
|
|
|
/** Example of how to do basic tests */
|
2020-04-28 06:33:09 -04:00
|
|
|
Deno.test("t1", function (): void {
|
2019-03-06 19:42:24 -05:00
|
|
|
assertEquals("hello", "hello");
|
2018-12-19 13:50:48 -05:00
|
|
|
});
|
|
|
|
|
2020-04-28 06:33:09 -04:00
|
|
|
Deno.test("t2", function (): void {
|
2019-03-06 19:42:24 -05:00
|
|
|
assertEquals("world", "world");
|
2018-12-19 13:50:48 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
/** A more complicated test that runs a subprocess. */
|
2020-04-28 06:33:09 -04:00
|
|
|
Deno.test("catSmoke", async function (): Promise<void> {
|
2020-06-12 15:23:38 -04:00
|
|
|
const p = Deno.run({
|
2020-03-21 17:44:18 -04:00
|
|
|
cmd: [
|
2019-08-13 20:03:29 -04:00
|
|
|
Deno.execPath(),
|
2019-07-29 04:46:21 -04:00
|
|
|
"run",
|
|
|
|
"--allow-read",
|
|
|
|
"examples/cat.ts",
|
2020-03-28 13:03:49 -04:00
|
|
|
"README.md",
|
2019-07-29 04:46:21 -04:00
|
|
|
],
|
2020-03-18 19:25:55 -04:00
|
|
|
stdout: "null",
|
2020-03-28 13:03:49 -04:00
|
|
|
stderr: "null",
|
2018-12-19 13:50:48 -05:00
|
|
|
});
|
|
|
|
const s = await p.status();
|
2019-03-06 19:42:24 -05:00
|
|
|
assertEquals(s.code, 0);
|
2020-03-18 19:25:55 -04:00
|
|
|
p.close();
|
2018-12-19 13:50:48 -05:00
|
|
|
});
|