diff options
Diffstat (limited to 'std/examples')
-rw-r--r-- | std/examples/test.ts | 7 | ||||
-rw-r--r-- | std/examples/tests/xeval_test.ts | 9 |
2 files changed, 7 insertions, 9 deletions
diff --git a/std/examples/test.ts b/std/examples/test.ts index 26dd989e4..641a2ef74 100644 --- a/std/examples/test.ts +++ b/std/examples/test.ts @@ -1,19 +1,18 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. const { run } = Deno; -import { test } from "../testing/mod.ts"; import { assertEquals } from "../testing/asserts.ts"; /** Example of how to do basic tests */ -test(function t1(): void { +Deno.test(function t1(): void { assertEquals("hello", "hello"); }); -test(function t2(): void { +Deno.test(function t2(): void { assertEquals("world", "world"); }); /** A more complicated test that runs a subprocess. */ -test(async function catSmoke(): Promise<void> { +Deno.test(async function catSmoke(): Promise<void> { const p = run({ args: [ Deno.execPath(), diff --git a/std/examples/tests/xeval_test.ts b/std/examples/tests/xeval_test.ts index 1c4be1f95..bfd66c097 100644 --- a/std/examples/tests/xeval_test.ts +++ b/std/examples/tests/xeval_test.ts @@ -6,16 +6,15 @@ import { assertStrContains, assert } from "../../testing/asserts.ts"; -import { test } from "../../testing/mod.ts"; const { execPath, run } = Deno; -test(async function xevalSuccess(): Promise<void> { +Deno.test(async function xevalSuccess(): Promise<void> { const chunks: string[] = []; await xeval(stringsReader("a\nb\nc"), ($): number => chunks.push($)); assertEquals(chunks, ["a", "b", "c"]); }); -test(async function xevalDelimiter(): Promise<void> { +Deno.test(async function xevalDelimiter(): Promise<void> { const chunks: string[] = []; await xeval(stringsReader("!MADMADAMADAM!"), ($): number => chunks.push($), { delimiter: "MADAM" @@ -26,7 +25,7 @@ test(async function xevalDelimiter(): Promise<void> { // https://github.com/denoland/deno/issues/2861 const xevalPath = "examples/xeval.ts"; -test(async function xevalCliReplvar(): Promise<void> { +Deno.test(async function xevalCliReplvar(): Promise<void> { const p = run({ args: [execPath(), xevalPath, "--", "--replvar=abc", "console.log(abc)"], stdin: "piped", @@ -40,7 +39,7 @@ test(async function xevalCliReplvar(): Promise<void> { assertEquals(decode(await p.output()).trimEnd(), "hello"); }); -test(async function xevalCliSyntaxError(): Promise<void> { +Deno.test(async function xevalCliSyntaxError(): Promise<void> { const p = run({ args: [execPath(), xevalPath, "--", "("], stdin: "null", |