diff options
author | HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> | 2024-09-16 22:38:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-16 19:38:40 +0000 |
commit | e0b9c745c15720914f14996bf357d5b375e2dbd8 (patch) | |
tree | 0dfc717082bedb2eec13eceb5cdeb1ef12b8f7f5 /tests/testdata | |
parent | 6ce16145dd12d8a272cb543871276c33c8201a37 (diff) |
chore: deprecate test itests (#25512)
This PR is part of #22907
---------
Signed-off-by: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com>
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests/testdata')
165 files changed, 12 insertions, 2761 deletions
diff --git a/tests/testdata/test/aggregate_error.out b/tests/testdata/test/aggregate_error.out deleted file mode 100644 index e70bf5963..000000000 --- a/tests/testdata/test/aggregate_error.out +++ /dev/null @@ -1,22 +0,0 @@ -running 1 test from ./test/aggregate_error.ts -aggregate ... FAILED ([WILDCARD]) - - ERRORS - -aggregate => ./test/aggregate_error.ts:[WILDCARD] -error: AggregateError - Error: Error 1 - at [WILDCARD]/testdata/test/aggregate_error.ts:2:18 - Error: Error 2 - at [WILDCARD]/testdata/test/aggregate_error.ts:3:18 - throw new AggregateError([error1, error2]); - ^ - at [WILDCARD]/testdata/test/aggregate_error.ts:5:9 - - FAILURES - -aggregate => ./test/aggregate_error.ts:[WILDCARD] - -FAILED | 0 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/aggregate_error.ts b/tests/testdata/test/aggregate_error.ts deleted file mode 100644 index 0661ea249..000000000 --- a/tests/testdata/test/aggregate_error.ts +++ /dev/null @@ -1,6 +0,0 @@ -Deno.test("aggregate", function () { - const error1 = new Error("Error 1"); - const error2 = new Error("Error 2"); - - throw new AggregateError([error1, error2]); -}); diff --git a/tests/testdata/test/allow_all.out b/tests/testdata/test/allow_all.out deleted file mode 100644 index b3bf5275f..000000000 --- a/tests/testdata/test/allow_all.out +++ /dev/null @@ -1,16 +0,0 @@ -[WILDCARD] -running 12 tests from [WILDCARD] -read false ... ok [WILDCARD] -read true ... ok [WILDCARD] -write false ... ok [WILDCARD] -write true ... ok [WILDCARD] -net false ... ok [WILDCARD] -net true ... ok [WILDCARD] -env false ... ok [WILDCARD] -env true ... ok [WILDCARD] -run false ... ok [WILDCARD] -run true ... ok [WILDCARD] -ffi false ... ok [WILDCARD] -ffi true ... ok [WILDCARD] - -ok | 12 passed | 0 failed [WILDCARD] diff --git a/tests/testdata/test/allow_all.ts b/tests/testdata/test/allow_all.ts deleted file mode 100644 index 7faa58c61..000000000 --- a/tests/testdata/test/allow_all.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { assertEquals } from "@std/assert"; - -const permissions: Deno.PermissionName[] = [ - "read", - "write", - "net", - "env", - "run", - "ffi", -]; - -for (const name of permissions) { - Deno.test({ - name: `${name} false`, - permissions: { - [name]: false, - }, - async fn() { - for await (const n of permissions) { - const status = await Deno.permissions.query({ name: n }); - assertEquals(status.state, "prompt"); - } - }, - }); - - Deno.test({ - name: `${name} true`, - permissions: { - [name]: true, - }, - async fn() { - for await (const n of permissions) { - const status = await Deno.permissions.query({ name: n }); - if (n === name) { - assertEquals(status.state, "granted"); - } else { - assertEquals(status.state, "prompt"); - } - } - }, - }); -} diff --git a/tests/testdata/test/allow_none.out b/tests/testdata/test/allow_none.out deleted file mode 100644 index 37ed8548a..000000000 --- a/tests/testdata/test/allow_none.out +++ /dev/null @@ -1,45 +0,0 @@ -[WILDCARD] -running 6 tests from [WILDCARD] -read ... FAILED [WILDCARD] -write ... FAILED [WILDCARD] -net ... FAILED [WILDCARD] -env ... FAILED [WILDCARD] -run ... FAILED [WILDCARD] -ffi ... FAILED [WILDCARD] - - ERRORS - -read => ./test/allow_none.ts:[WILDCARD] -error: NotCapable: Can't escalate parent thread permissions -[WILDCARD] - -write => ./test/allow_none.ts:[WILDCARD] -error: NotCapable: Can't escalate parent thread permissions -[WILDCARD] - -net => ./test/allow_none.ts:[WILDCARD] -error: NotCapable: Can't escalate parent thread permissions -[WILDCARD] - -env => ./test/allow_none.ts:[WILDCARD] -error: NotCapable: Can't escalate parent thread permissions -[WILDCARD] - -run => ./test/allow_none.ts:[WILDCARD] -error: NotCapable: Can't escalate parent thread permissions -[WILDCARD] - -ffi => ./test/allow_none.ts:[WILDCARD] -error: NotCapable: Can't escalate parent thread permissions -[WILDCARD] - - FAILURES - -read => ./test/allow_none.ts:[WILDCARD] -write => ./test/allow_none.ts:[WILDCARD] -net => ./test/allow_none.ts:[WILDCARD] -env => ./test/allow_none.ts:[WILDCARD] -run => ./test/allow_none.ts:[WILDCARD] -ffi => ./test/allow_none.ts:[WILDCARD] - -FAILED | 0 passed | 6 failed [WILDCARD] diff --git a/tests/testdata/test/allow_none.ts b/tests/testdata/test/allow_none.ts deleted file mode 100644 index e59a30c4d..000000000 --- a/tests/testdata/test/allow_none.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { unreachable } from "@std/assert"; - -const permissions: Deno.PermissionName[] = [ - "read", - "write", - "net", - "env", - "run", - "ffi", -]; - -for (const name of permissions) { - Deno.test({ - name, - permissions: { - [name]: true, - }, - fn() { - unreachable(); - }, - }); -} diff --git a/tests/testdata/test/before_unload_prevent_default.out b/tests/testdata/test/before_unload_prevent_default.out deleted file mode 100644 index 09da32ff9..000000000 --- a/tests/testdata/test/before_unload_prevent_default.out +++ /dev/null @@ -1,5 +0,0 @@ -running 1 test from [WILDCARD]/before_unload_prevent_default.ts -foo ... ok ([WILDCARD]) - -ok | 1 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/before_unload_prevent_default.ts b/tests/testdata/test/before_unload_prevent_default.ts deleted file mode 100644 index 421ded520..000000000 --- a/tests/testdata/test/before_unload_prevent_default.ts +++ /dev/null @@ -1,6 +0,0 @@ -addEventListener("beforeunload", (e) => { - // The worker should be killed once tests are done regardless of this. - e.preventDefault(); -}); - -Deno.test("foo", () => {}); diff --git a/tests/testdata/test/captured_output.ts b/tests/testdata/test/captured_output.ts deleted file mode 100644 index 3eed249a2..000000000 --- a/tests/testdata/test/captured_output.ts +++ /dev/null @@ -1,33 +0,0 @@ -Deno.test("output", async () => { - await new Deno.Command(Deno.execPath(), { - args: ["eval", "console.log(0); console.error(1);"], - }).spawn().status; - new Deno.Command(Deno.execPath(), { - args: ["eval", "console.log(2); console.error(3);"], - stdout: "inherit", - stderr: "inherit", - }).outputSync(); - await new Deno.Command(Deno.execPath(), { - args: ["eval", "console.log(4); console.error(5);"], - stdout: "inherit", - stderr: "inherit", - }).output(); - const c = new Deno.Command(Deno.execPath(), { - args: ["eval", "console.log(6); console.error(7);"], - stdout: "inherit", - stderr: "inherit", - }).spawn(); - await c.status; - const worker = new Worker( - import.meta.resolve("./captured_output.worker.js"), - { type: "module" }, - ); - - // ensure worker output is captured - const response = new Promise<void>((resolve) => - worker.onmessage = () => resolve() - ); - worker.postMessage({}); - await response; - worker.terminate(); -}); diff --git a/tests/testdata/test/captured_output.worker.js b/tests/testdata/test/captured_output.worker.js deleted file mode 100644 index f49f26880..000000000 --- a/tests/testdata/test/captured_output.worker.js +++ /dev/null @@ -1,6 +0,0 @@ -self.onmessage = () => { - console.log(8); - console.error(9); - self.postMessage({}); - self.close(); -}; diff --git a/tests/testdata/test/check_local_by_default.out b/tests/testdata/test/check_local_by_default.out deleted file mode 100644 index 4564f99b8..000000000 --- a/tests/testdata/test/check_local_by_default.out +++ /dev/null @@ -1,4 +0,0 @@ -running 0 tests from ./test/check_local_by_default.ts - -ok | 0 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/check_local_by_default.ts b/tests/testdata/test/check_local_by_default.ts deleted file mode 100644 index 2ae8c2692..000000000 --- a/tests/testdata/test/check_local_by_default.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as a from "http://localhost:4545/subdir/type_error.ts"; - -console.log(a.a); diff --git a/tests/testdata/test/check_local_by_default2.out b/tests/testdata/test/check_local_by_default2.out deleted file mode 100644 index b933ac483..000000000 --- a/tests/testdata/test/check_local_by_default2.out +++ /dev/null @@ -1,4 +0,0 @@ -error: TS2322 [ERROR]: Type '12' is not assignable to type '"b"'. -const b: "b" = 12; - ^ - at [WILDCARD]test/check_local_by_default2.ts:3:7 diff --git a/tests/testdata/test/check_local_by_default2.ts b/tests/testdata/test/check_local_by_default2.ts deleted file mode 100644 index 5177ff944..000000000 --- a/tests/testdata/test/check_local_by_default2.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as a from "http://localhost:4545/subdir/type_error.ts"; - -const b: "b" = 12; - -console.log(a.a); -console.log(b); diff --git a/tests/testdata/test/clear_timeout.out b/tests/testdata/test/clear_timeout.out deleted file mode 100644 index 4d3ff8862..000000000 --- a/tests/testdata/test/clear_timeout.out +++ /dev/null @@ -1,8 +0,0 @@ -Check [WILDCARD]/test/clear_timeout.ts -running 3 tests from ./test/clear_timeout.ts -test 1 ... ok ([WILDCARD]) -test 2 ... ok ([WILDCARD]) -test 3 ... ok ([WILDCARD]) - -ok | 3 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/clear_timeout.ts b/tests/testdata/test/clear_timeout.ts deleted file mode 100644 index 00056e853..000000000 --- a/tests/testdata/test/clear_timeout.ts +++ /dev/null @@ -1,5 +0,0 @@ -clearTimeout(setTimeout(() => {}, 1000)); - -Deno.test("test 1", () => {}); -Deno.test("test 2", () => {}); -Deno.test("test 3", () => {}); diff --git a/tests/testdata/test/collect.out b/tests/testdata/test/collect.out deleted file mode 100644 index 734adbe6b..000000000 --- a/tests/testdata/test/collect.out +++ /dev/null @@ -1,9 +0,0 @@ -Check [WILDCARD]/test/collect/include/2_test.ts -Check [WILDCARD]/test/collect/include/test.ts -Check [WILDCARD]/test/collect/test.ts -running 0 tests from [WILDCARD]/test/collect/include/2_test.ts -running 0 tests from [WILDCARD]/test/collect/include/test.ts -running 0 tests from [WILDCARD]/test/collect/test.ts - -ok | 0 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/collect/deno.jsonc b/tests/testdata/test/collect/deno.jsonc deleted file mode 100644 index e14ce86da..000000000 --- a/tests/testdata/test/collect/deno.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "test": { - "exclude": ["./ignore"] - } -} diff --git a/tests/testdata/test/collect/deno.malformed.jsonc b/tests/testdata/test/collect/deno.malformed.jsonc deleted file mode 100644 index f2d8cbc65..000000000 --- a/tests/testdata/test/collect/deno.malformed.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "test": { - "dont_know_this_field": {} - } -} diff --git a/tests/testdata/test/collect/deno2.jsonc b/tests/testdata/test/collect/deno2.jsonc deleted file mode 100644 index b7af09d1c..000000000 --- a/tests/testdata/test/collect/deno2.jsonc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "test": { - "include": ["./include/"], - "exclude": ["./ignore", "./include/2_test.ts"] - } -} diff --git a/tests/testdata/test/collect/ignore/test.ts b/tests/testdata/test/collect/ignore/test.ts deleted file mode 100644 index 16fb63ba7..000000000 --- a/tests/testdata/test/collect/ignore/test.ts +++ /dev/null @@ -1 +0,0 @@ -throw new Error("this module should be ignored"); diff --git a/tests/testdata/test/collect/include.ts b/tests/testdata/test/collect/include.ts deleted file mode 100644 index e69de29bb..000000000 --- a/tests/testdata/test/collect/include.ts +++ /dev/null diff --git a/tests/testdata/test/collect/include/2_test.ts b/tests/testdata/test/collect/include/2_test.ts deleted file mode 100644 index e69de29bb..000000000 --- a/tests/testdata/test/collect/include/2_test.ts +++ /dev/null diff --git a/tests/testdata/test/collect/include/test.ts b/tests/testdata/test/collect/include/test.ts deleted file mode 100644 index e69de29bb..000000000 --- a/tests/testdata/test/collect/include/test.ts +++ /dev/null diff --git a/tests/testdata/test/collect/test.ts b/tests/testdata/test/collect/test.ts deleted file mode 100644 index e69de29bb..000000000 --- a/tests/testdata/test/collect/test.ts +++ /dev/null diff --git a/tests/testdata/test/collect2.out b/tests/testdata/test/collect2.out deleted file mode 100644 index 0c00c956a..000000000 --- a/tests/testdata/test/collect2.out +++ /dev/null @@ -1,7 +0,0 @@ -Check [WILDCARD]/test/collect/include/test.ts -Check [WILDCARD]/test/collect/test.ts -running 0 tests from [WILDCARD]/test/collect/include/test.ts -running 0 tests from [WILDCARD]/test/collect/test.ts - -ok | 0 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/collect_with_malformed_config.out b/tests/testdata/test/collect_with_malformed_config.out deleted file mode 100644 index b31b18e6a..000000000 --- a/tests/testdata/test/collect_with_malformed_config.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Failed to parse "test" configuration - -Caused by: - unknown field `dont_know_this_field`, expected one of `include`, `exclude`, `files` diff --git a/tests/testdata/test/deno_custom_jsx.json b/tests/testdata/test/deno_custom_jsx.json deleted file mode 100644 index 7ef04d829..000000000 --- a/tests/testdata/test/deno_custom_jsx.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "https://esm.sh/react@18.1.0" - } -} diff --git a/tests/testdata/test/doc.out b/tests/testdata/test/doc.out deleted file mode 100644 index cd8bbb620..000000000 --- a/tests/testdata/test/doc.out +++ /dev/null @@ -1,9 +0,0 @@ -Check [WILDCARD]/doc.ts$6-9.js -Check [WILDCARD]/doc.ts$10-13.jsx -Check [WILDCARD]/doc.ts$14-17.ts -Check [WILDCARD]/doc.ts$18-21.tsx -Check [WILDCARD]/doc.ts$30-35.ts -error: TS2367 [ERROR]: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -console.assert(check() == 42); - ~~~~~~~~~~~~~ - at [WILDCARD]/doc.ts$30-35.ts:3:16 diff --git a/tests/testdata/test/doc.ts b/tests/testdata/test/doc.ts deleted file mode 100644 index 519479fc5..000000000 --- a/tests/testdata/test/doc.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * ``` - * import * as doc from "./doc.ts"; - * ``` - * - * ```js - * import * as doc from "./doc.ts"; - * ``` - * - * ```jsx - * import * as doc from "./doc.ts"; - * ``` - * - * ```ts - * import * as doc from "./doc.ts"; - * ``` - * - * ```tsx - * import * as doc from "./doc.ts"; - * ``` - * - * ```text - * import * as doc from "./doc.ts"; - * ``` - * - * @module doc - */ - -/** - * ```ts - * import { check } from "./doc.ts"; - * - * console.assert(check() == 42); - * ``` - */ -export function check(): string { - return "check"; -} diff --git a/tests/testdata/test/doc_only.out b/tests/testdata/test/doc_only.out deleted file mode 100644 index 2b8b6dc73..000000000 --- a/tests/testdata/test/doc_only.out +++ /dev/null @@ -1,4 +0,0 @@ -Check [WILDCARD]/test/doc_only/mod.ts$2-5.ts - -ok | 0 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/doc_only/mod.ts b/tests/testdata/test/doc_only/mod.ts deleted file mode 100644 index 467d850a2..000000000 --- a/tests/testdata/test/doc_only/mod.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * ```ts - * import "./mod.ts"; - * ``` - */ -Deno.test("unreachable", function () { - throw new Error( - "modules that don't end with _test are scanned for documentation tests only should not be executed", - ); -}); diff --git a/tests/testdata/test/fail.out b/tests/testdata/test/fail.out deleted file mode 100644 index 3fcf6fd8f..000000000 --- a/tests/testdata/test/fail.out +++ /dev/null @@ -1,91 +0,0 @@ -Check [WILDCARD]/test/fail.ts -running 10 tests from ./test/fail.ts -test 0 ... FAILED ([WILDCARD]) -test 1 ... FAILED ([WILDCARD]) -test 2 ... FAILED ([WILDCARD]) -test 3 ... FAILED ([WILDCARD]) -test 4 ... FAILED ([WILDCARD]) -test 5 ... FAILED ([WILDCARD]) -test 6 ... FAILED ([WILDCARD]) -test 7 ... FAILED ([WILDCARD]) -test 8 ... FAILED ([WILDCARD]) -test 9 ... FAILED ([WILDCARD]) - - ERRORS - -test 0 => ./test/fail.ts:1:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:2:9 - -test 1 => ./test/fail.ts:4:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:5:9 - -test 2 => ./test/fail.ts:7:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:8:9 - -test 3 => ./test/fail.ts:10:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:11:9 - -test 4 => ./test/fail.ts:13:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:14:9 - -test 5 => ./test/fail.ts:16:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:17:9 - -test 6 => ./test/fail.ts:19:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:20:9 - -test 7 => ./test/fail.ts:22:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:23:9 - -test 8 => ./test/fail.ts:25:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:26:9 - -test 9 => ./test/fail.ts:28:6 -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail.ts:29:9 - - FAILURES - -test 0 => ./test/fail.ts:1:6 -test 1 => ./test/fail.ts:4:6 -test 2 => ./test/fail.ts:7:6 -test 3 => ./test/fail.ts:10:6 -test 4 => ./test/fail.ts:13:6 -test 5 => ./test/fail.ts:16:6 -test 6 => ./test/fail.ts:19:6 -test 7 => ./test/fail.ts:22:6 -test 8 => ./test/fail.ts:25:6 -test 9 => ./test/fail.ts:28:6 - -FAILED | 0 passed | 10 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/fail.ts b/tests/testdata/test/fail.ts deleted file mode 100644 index 9340db556..000000000 --- a/tests/testdata/test/fail.ts +++ /dev/null @@ -1,30 +0,0 @@ -Deno.test("test 0", () => { - throw new Error(); -}); -Deno.test("test 1", () => { - throw new Error(); -}); -Deno.test("test 2", () => { - throw new Error(); -}); -Deno.test("test 3", () => { - throw new Error(); -}); -Deno.test("test 4", () => { - throw new Error(); -}); -Deno.test("test 5", () => { - throw new Error(); -}); -Deno.test("test 6", () => { - throw new Error(); -}); -Deno.test("test 7", () => { - throw new Error(); -}); -Deno.test("test 8", () => { - throw new Error(); -}); -Deno.test("test 9", () => { - throw new Error(); -}); diff --git a/tests/testdata/test/fail_fast.out b/tests/testdata/test/fail_fast.out deleted file mode 100644 index 606d5b345..000000000 --- a/tests/testdata/test/fail_fast.out +++ /dev/null @@ -1,20 +0,0 @@ -Check [WILDCARD]/test/fail_fast.ts -Check [WILDCARD]/test/fail_fast_other.ts -running 10 tests from ./test/fail_fast.ts -test 1 ... FAILED ([WILDCARD]) - - ERRORS - -test 1 => ./test/fail_fast.ts:[WILDCARD] -error: Error - throw new Error(); - ^ - at [WILDCARD]/test/fail_fast.ts:2:9 - - FAILURES - -test 1 => ./test/fail_fast.ts:[WILDCARD] - -FAILED | 0 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/fail_fast.ts b/tests/testdata/test/fail_fast.ts deleted file mode 100644 index 637e825ec..000000000 --- a/tests/testdata/test/fail_fast.ts +++ /dev/null @@ -1,30 +0,0 @@ -Deno.test("test 1", () => { - throw new Error(); -}); -Deno.test("test 2", () => { - throw new Error(); -}); -Deno.test("test 3", () => { - throw new Error(); -}); -Deno.test("test 4", () => { - throw new Error(); -}); -Deno.test("test 5", () => { - throw new Error(); -}); -Deno.test("test 6", () => { - throw new Error(); -}); -Deno.test("test 7", () => { - throw new Error(); -}); -Deno.test("test 8", () => { - throw new Error(); -}); -Deno.test("test 9", () => { - throw new Error(); -}); -Deno.test("test 0", () => { - throw new Error(); -}); diff --git a/tests/testdata/test/fail_fast_other.ts b/tests/testdata/test/fail_fast_other.ts deleted file mode 100644 index 02aa878cf..000000000 --- a/tests/testdata/test/fail_fast_other.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.test("test 11", () => { - throw new Error(); -}); diff --git a/tests/testdata/test/fail_fast_with_val.out b/tests/testdata/test/fail_fast_with_val.out deleted file mode 100644 index a844b05c1..000000000 --- a/tests/testdata/test/fail_fast_with_val.out +++ /dev/null @@ -1,23 +0,0 @@ -[WILDCARD] -running 10 tests from [WILDCARD]/test/fail_fast_with_val.ts -test test 1 ... FAILED ([WILDCARD]) -test test 2 ... FAILED ([WILDCARD]) - - ERRORS - -test 1 => ./test/fail_fast_with_val.ts:[WILDCARD] -error: Error - at [WILDCARD]/test/fail_fast_with_val.ts:2:9 - at [WILDCARD] - -test 2 => ./test/fail_fast_with_val.ts:[WILDCARD] -error: Error - at [WILDCARD]/test/fail_fast_with_val.ts:5:9 - at [WILDCARD] - - FAILURES - -test 1 => ./test/fail_fast_with_val.ts:[WILDCARD] -test 2 => ./test/fail_fast_with_val.ts:[WILDCARD] - -FAILED | 0 passed | 2 failed ([WILDCARD]) diff --git a/tests/testdata/test/fail_fast_with_val.ts b/tests/testdata/test/fail_fast_with_val.ts deleted file mode 100644 index 637e825ec..000000000 --- a/tests/testdata/test/fail_fast_with_val.ts +++ /dev/null @@ -1,30 +0,0 @@ -Deno.test("test 1", () => { - throw new Error(); -}); -Deno.test("test 2", () => { - throw new Error(); -}); -Deno.test("test 3", () => { - throw new Error(); -}); -Deno.test("test 4", () => { - throw new Error(); -}); -Deno.test("test 5", () => { - throw new Error(); -}); -Deno.test("test 6", () => { - throw new Error(); -}); -Deno.test("test 7", () => { - throw new Error(); -}); -Deno.test("test 8", () => { - throw new Error(); -}); -Deno.test("test 9", () => { - throw new Error(); -}); -Deno.test("test 0", () => { - throw new Error(); -}); diff --git a/tests/testdata/test/file_protocol.out b/tests/testdata/test/file_protocol.out deleted file mode 100644 index 3f9c73f7e..000000000 --- a/tests/testdata/test/file_protocol.out +++ /dev/null @@ -1,6 +0,0 @@ -Check file://[WILDCARD]/test/file_protocol.ts -running 1 test from ./test/file_protocol.ts -test 0 ... ok ([WILDCARD]) - -ok | 1 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/file_protocol.ts b/tests/testdata/test/file_protocol.ts deleted file mode 100644 index 79128c2b3..000000000 --- a/tests/testdata/test/file_protocol.ts +++ /dev/null @@ -1 +0,0 @@ -Deno.test("test 0", () => {}); diff --git a/tests/testdata/test/filter.out b/tests/testdata/test/filter.out deleted file mode 100644 index af3e43ab8..000000000 --- a/tests/testdata/test/filter.out +++ /dev/null @@ -1,12 +0,0 @@ -Check [WILDCARD]/test/filter/a_test.ts -Check [WILDCARD]/test/filter/b_test.ts -Check [WILDCARD]/test/filter/c_test.ts -running 1 test from [WILDCARD]/test/filter/a_test.ts -foo ... ok ([WILDCARD]) -running 1 test from [WILDCARD]/test/filter/b_test.ts -foo ... ok ([WILDCARD]) -running 1 test from [WILDCARD]/test/filter/c_test.ts -foo ... ok ([WILDCARD]) - -ok | 3 passed | 0 failed | 6 filtered out ([WILDCARD]) - diff --git a/tests/testdata/test/filter/a_test.ts b/tests/testdata/test/filter/a_test.ts deleted file mode 100644 index a3f32968a..000000000 --- a/tests/testdata/test/filter/a_test.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.test("foo", function () {}); -Deno.test("bar", function () {}); -Deno.test("baz", function () {}); diff --git a/tests/testdata/test/filter/b_test.ts b/tests/testdata/test/filter/b_test.ts deleted file mode 100644 index a3f32968a..000000000 --- a/tests/testdata/test/filter/b_test.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.test("foo", function () {}); -Deno.test("bar", function () {}); -Deno.test("baz", function () {}); diff --git a/tests/testdata/test/filter/c_test.ts b/tests/testdata/test/filter/c_test.ts deleted file mode 100644 index a3f32968a..000000000 --- a/tests/testdata/test/filter/c_test.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.test("foo", function () {}); -Deno.test("bar", function () {}); -Deno.test("baz", function () {}); diff --git a/tests/testdata/test/filtered_out_only.out b/tests/testdata/test/filtered_out_only.out deleted file mode 100644 index 337893848..000000000 --- a/tests/testdata/test/filtered_out_only.out +++ /dev/null @@ -1,5 +0,0 @@ -running 1 test from ./test/filtered_out_only.ts -foo ... ok ([WILDCARD]) - -ok | 1 passed | 0 failed | 1 filtered out ([WILDCARD]) - diff --git a/tests/testdata/test/filtered_out_only.ts b/tests/testdata/test/filtered_out_only.ts deleted file mode 100644 index bda301a43..000000000 --- a/tests/testdata/test/filtered_out_only.ts +++ /dev/null @@ -1,2 +0,0 @@ -Deno.test("foo", () => {}); -Deno.test("bar", { only: true }, () => {}); diff --git a/tests/testdata/test/finally_timeout.out b/tests/testdata/test/finally_timeout.out deleted file mode 100644 index 26153da06..000000000 --- a/tests/testdata/test/finally_timeout.out +++ /dev/null @@ -1,20 +0,0 @@ -Check [WILDCARD]/test/finally_timeout.ts -running 2 tests from ./test/finally_timeout.ts -error ... FAILED ([WILDCARD]) -success ... ok ([WILDCARD]) - - ERRORS - -error => ./test/finally_timeout.ts:[WILDCARD] -error: Error: fail - throw new Error("fail"); - ^ - at [WILDCARD]/test/finally_timeout.ts:4:11 - - FAILURES - -error => ./test/finally_timeout.ts:[WILDCARD] - -FAILED | 1 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/finally_timeout.ts b/tests/testdata/test/finally_timeout.ts deleted file mode 100644 index dcc0a4d64..000000000 --- a/tests/testdata/test/finally_timeout.ts +++ /dev/null @@ -1,11 +0,0 @@ -Deno.test("error", function () { - const timer = setTimeout(() => null, 10000); - try { - throw new Error("fail"); - } finally { - clearTimeout(timer); - } -}); - -Deno.test("success", function () { -}); diff --git a/tests/testdata/test/glob/data/tes.ts b/tests/testdata/test/glob/data/tes.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/data/tes.ts +++ b/tests/testdata/test/glob/data/tes.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/data/test1.js b/tests/testdata/test/glob/data/test1.js index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/data/test1.js +++ b/tests/testdata/test/glob/data/test1.js @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/data/test1.ts b/tests/testdata/test/glob/data/test1.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/data/test1.ts +++ b/tests/testdata/test/glob/data/test1.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/data/test12.ts b/tests/testdata/test/glob/data/test12.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/data/test12.ts +++ b/tests/testdata/test/glob/data/test12.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/nested/fizz/bar.ts b/tests/testdata/test/glob/nested/fizz/bar.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/nested/fizz/bar.ts +++ b/tests/testdata/test/glob/nested/fizz/bar.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/nested/fizz/bazz.ts b/tests/testdata/test/glob/nested/fizz/bazz.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/nested/fizz/bazz.ts +++ b/tests/testdata/test/glob/nested/fizz/bazz.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/nested/fizz/foo.ts b/tests/testdata/test/glob/nested/fizz/foo.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/nested/fizz/foo.ts +++ b/tests/testdata/test/glob/nested/fizz/foo.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/nested/foo/bar.ts b/tests/testdata/test/glob/nested/foo/bar.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/nested/foo/bar.ts +++ b/tests/testdata/test/glob/nested/foo/bar.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/nested/foo/bazz.ts b/tests/testdata/test/glob/nested/foo/bazz.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/nested/foo/bazz.ts +++ b/tests/testdata/test/glob/nested/foo/bazz.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/nested/foo/fizz.ts b/tests/testdata/test/glob/nested/foo/fizz.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/nested/foo/fizz.ts +++ b/tests/testdata/test/glob/nested/foo/fizz.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/nested/foo/foo.ts b/tests/testdata/test/glob/nested/foo/foo.ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/nested/foo/foo.ts +++ b/tests/testdata/test/glob/nested/foo/foo.ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/glob/pages/[id].ts b/tests/testdata/test/glob/pages/[id].ts index 26f07fba5..6940729e9 100644 --- a/tests/testdata/test/glob/pages/[id].ts +++ b/tests/testdata/test/glob/pages/[id].ts @@ -1,3 +1,2 @@ function foo() { - -}
\ No newline at end of file +} diff --git a/tests/testdata/test/hello_world.out b/tests/testdata/test/hello_world.out deleted file mode 100644 index aee8a64d4..000000000 --- a/tests/testdata/test/hello_world.out +++ /dev/null @@ -1,5 +0,0 @@ -running 1 test from ./test/hello_world.ts -hello world test ... ok ([WILDCARD]) - -ok | 1 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/hello_world.ts b/tests/testdata/test/hello_world.ts deleted file mode 100644 index 4a1c3463f..000000000 --- a/tests/testdata/test/hello_world.ts +++ /dev/null @@ -1,9 +0,0 @@ -Deno.test({ - name: "hello world test", - fn(): void { - const world = "world"; - if ("world" !== world) { - throw new Error("world !== world"); - } - }, -}); diff --git a/tests/testdata/test/hide_empty_suites.out b/tests/testdata/test/hide_empty_suites.out deleted file mode 100644 index d270cb05a..000000000 --- a/tests/testdata/test/hide_empty_suites.out +++ /dev/null @@ -1,4 +0,0 @@ -Check [WILDCARD]/test/pass.ts - -ok | 0 passed | 0 failed | 16 filtered out ([WILDCARD]) - diff --git a/tests/testdata/test/ignore.out b/tests/testdata/test/ignore.out deleted file mode 100644 index e67406c63..000000000 --- a/tests/testdata/test/ignore.out +++ /dev/null @@ -1,15 +0,0 @@ -Check [WILDCARD]/test/ignore.ts -running 10 tests from ./test/ignore.ts -test 0 ... ignored ([WILDCARD]) -test 1 ... ignored ([WILDCARD]) -test 2 ... ignored ([WILDCARD]) -test 3 ... ignored ([WILDCARD]) -test 4 ... ignored ([WILDCARD]) -test 5 ... ignored ([WILDCARD]) -test 6 ... ignored ([WILDCARD]) -test 7 ... ignored ([WILDCARD]) -test 8 ... ignored ([WILDCARD]) -test 9 ... ignored ([WILDCARD]) - -ok | 0 passed | 0 failed | 10 ignored ([WILDCARD]) - diff --git a/tests/testdata/test/ignore.ts b/tests/testdata/test/ignore.ts deleted file mode 100644 index 2339835db..000000000 --- a/tests/testdata/test/ignore.ts +++ /dev/null @@ -1,17 +0,0 @@ -for (let i = 0; i < 5; i++) { - Deno.test({ - name: `test ${i}`, - ignore: true, - fn() { - throw new Error("unreachable"); - }, - }); -} -for (let i = 5; i < 10; i++) { - Deno.test.ignore({ - name: `test ${i}`, - fn() { - throw new Error("unreachable"); - }, - }); -} diff --git a/tests/testdata/test/ignore_permissions.out b/tests/testdata/test/ignore_permissions.out deleted file mode 100644 index cc2574da9..000000000 --- a/tests/testdata/test/ignore_permissions.out +++ /dev/null @@ -1,6 +0,0 @@ -Check [WILDCARD]/test/ignore_permissions.ts -running 1 test from ./test/ignore_permissions.ts -ignore ... ignored ([WILDCARD]) - -ok | 0 passed | 0 failed | 1 ignored ([WILDCARD]) - diff --git a/tests/testdata/test/ignore_permissions.ts b/tests/testdata/test/ignore_permissions.ts deleted file mode 100644 index e9ade6dfe..000000000 --- a/tests/testdata/test/ignore_permissions.ts +++ /dev/null @@ -1,15 +0,0 @@ -Deno.test({ - name: "ignore", - permissions: { - read: true, - write: true, - net: true, - env: true, - run: true, - ffi: true, - }, - ignore: true, - fn() { - throw new Error("unreachable"); - }, -}); diff --git a/tests/testdata/test/interval.out b/tests/testdata/test/interval.out deleted file mode 100644 index 1d0bc15ac..000000000 --- a/tests/testdata/test/interval.out +++ /dev/null @@ -1,5 +0,0 @@ -Check [WILDCARD]/test/interval.ts -running 0 tests from ./test/interval.ts - -ok | 0 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/interval.ts b/tests/testdata/test/interval.ts deleted file mode 100644 index 7eb588c59..000000000 --- a/tests/testdata/test/interval.ts +++ /dev/null @@ -1 +0,0 @@ -setInterval(function () {}, 0); diff --git a/tests/testdata/test/junit_multiple_test_files.junit.out b/tests/testdata/test/junit_multiple_test_files.junit.out deleted file mode 100644 index bf6f3eaa4..000000000 --- a/tests/testdata/test/junit_multiple_test_files.junit.out +++ /dev/null @@ -1,102 +0,0 @@ -Check file:///[WILDCARD]/test/pass.ts -Check file:///[WILDCARD]/test/fail.ts -<?xml version="1.0" encoding="UTF-8"?> -<testsuites name="deno test" tests="26" failures="10" errors="0" time="[WILDCARD]"> - <testsuite name="./test/pass.ts" tests="16" disabled="0" errors="0" failures="0"> - <testcase name="test 0" classname="./test/pass.ts" time="[WILDCARD]" line="1" col="6"> - </testcase> - <testcase name="test 1" classname="./test/pass.ts" time="[WILDCARD]" line="2" col="6"> - </testcase> - <testcase name="test 2" classname="./test/pass.ts" time="[WILDCARD]" line="3" col="6"> - </testcase> - <testcase name="test 3" classname="./test/pass.ts" time="[WILDCARD]" line="4" col="6"> - </testcase> - <testcase name="test 4" classname="./test/pass.ts" time="[WILDCARD]" line="5" col="6"> - </testcase> - <testcase name="test 5" classname="./test/pass.ts" time="[WILDCARD]" line="6" col="6"> - </testcase> - <testcase name="test 6" classname="./test/pass.ts" time="[WILDCARD]" line="7" col="6"> - </testcase> - <testcase name="test 7" classname="./test/pass.ts" time="[WILDCARD]" line="8" col="6"> - </testcase> - <testcase name="test 8" classname="./test/pass.ts" time="[WILDCARD]" line="9" col="6"> - </testcase> - <testcase name="test 9" classname="./test/pass.ts" time="[WILDCARD]" line="12" col="6"> - </testcase> - <testcase name="test\b" classname="./test/pass.ts" time="[WILDCARD]" line="16" col="6"> - </testcase> - <testcase name="test\f" classname="./test/pass.ts" time="[WILDCARD]" line="19" col="6"> - </testcase> - <testcase name="test\t" classname="./test/pass.ts" time="[WILDCARD]" line="23" col="6"> - </testcase> - <testcase name="test\n" classname="./test/pass.ts" time="[WILDCARD]" line="27" col="6"> - </testcase> - <testcase name="test\r" classname="./test/pass.ts" time="[WILDCARD]" line="31" col="6"> - </testcase> - <testcase name="test\v" classname="./test/pass.ts" time="[WILDCARD]" line="35" col="6"> - </testcase> - </testsuite> - <testsuite name="./test/fail.ts" tests="10" disabled="0" errors="0" failures="10"> - <testcase name="test 0" classname="./test/fail.ts" time="[WILDCARD]" line="1" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:2:9</failure> - </testcase> - <testcase name="test 1" classname="./test/fail.ts" time="[WILDCARD]" line="4" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:5:9</failure> - </testcase> - <testcase name="test 2" classname="./test/fail.ts" time="[WILDCARD]" line="7" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:8:9</failure> - </testcase> - <testcase name="test 3" classname="./test/fail.ts" time="[WILDCARD]" line="10" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:11:9</failure> - </testcase> - <testcase name="test 4" classname="./test/fail.ts" time="[WILDCARD]" line="13" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:14:9</failure> - </testcase> - <testcase name="test 5" classname="./test/fail.ts" time="[WILDCARD]" line="16" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:17:9</failure> - </testcase> - <testcase name="test 6" classname="./test/fail.ts" time="[WILDCARD]" line="19" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:20:9</failure> - </testcase> - <testcase name="test 7" classname="./test/fail.ts" time="[WILDCARD]" line="22" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:23:9</failure> - </testcase> - <testcase name="test 8" classname="./test/fail.ts" time="[WILDCARD]" line="25" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:26:9</failure> - </testcase> - <testcase name="test 9" classname="./test/fail.ts" time="[WILDCARD]" line="28" col="6"> - <failure message="Uncaught Error">Error - throw new Error(); - ^ - at file:///[WILDCARD]/test/fail.ts:29:9</failure> - </testcase> - </testsuite> -</testsuites> -error: Test failed diff --git a/tests/testdata/test/load_unload.out b/tests/testdata/test/load_unload.out deleted file mode 100644 index 75187fa7b..000000000 --- a/tests/testdata/test/load_unload.out +++ /dev/null @@ -1,16 +0,0 @@ -Check [WILDCARD]/load_unload.ts -------- pre-test output ------- -load ------ pre-test output end ----- -running 1 test from [WILDCARD]/load_unload.ts -test ... -------- output ------- -test ------ output end ----- -test ... ok ([WILDCARD]) -------- post-test output ------- -unload ------ post-test output end ----- - -ok | 1 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/load_unload.ts b/tests/testdata/test/load_unload.ts deleted file mode 100644 index 5027b949a..000000000 --- a/tests/testdata/test/load_unload.ts +++ /dev/null @@ -1,25 +0,0 @@ -let interval: number | null = null; -addEventListener("load", () => { - if (interval) { - throw new Error("Interval is already set"); - } - - console.log("load"); - interval = setInterval(() => {}, 0); -}); - -addEventListener("unload", () => { - if (!interval) { - throw new Error("Interval was not set"); - } - - console.log("unload"); - clearInterval(interval); -}); - -Deno.test("test", () => { - console.log("test"); - if (!interval) { - throw new Error("Interval was not set"); - } -}); diff --git a/tests/testdata/test/markdown.md b/tests/testdata/test/markdown.md deleted file mode 100644 index d18dbd108..000000000 --- a/tests/testdata/test/markdown.md +++ /dev/null @@ -1,31 +0,0 @@ -# Documentation - -The following block does not have a language attribute and should be ignored: - -``` -This is a fenced block without attributes, it's invalid and it should be ignored. -``` - -The following block should be given a js extension on extraction: - -```js -console.log("js"); -``` - -The following block should be given a ts extension on extraction: - -```ts -console.log("ts"); -``` - -The following example contains the ignore attribute and will be ignored: - -```ts ignore -const value: Invalid = "ignored"; -``` - -The following example will trigger the type-checker to fail: - -```ts -const a: string = 42; -``` diff --git a/tests/testdata/test/markdown.out b/tests/testdata/test/markdown.out deleted file mode 100644 index 38c9f0349..000000000 --- a/tests/testdata/test/markdown.out +++ /dev/null @@ -1,7 +0,0 @@ -Check [WILDCARD]/test/markdown.md$11-14.js -Check [WILDCARD]/test/markdown.md$17-20.ts -Check [WILDCARD]/test/markdown.md$29-32.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const a: string = 42; - ^ - at [WILDCARD]/test/markdown.md$29-32.ts:1:7 diff --git a/tests/testdata/test/markdown_full_block_names.md b/tests/testdata/test/markdown_full_block_names.md deleted file mode 100644 index 4f9e1ea51..000000000 --- a/tests/testdata/test/markdown_full_block_names.md +++ /dev/null @@ -1,19 +0,0 @@ -# Documentation - -The following block should be given a js extension on extraction: - -```javascript -console.log("js"); -``` - -The following example contains the ignore attribute and will be ignored: - -```typescript ignore -const value: Invalid = "ignored"; -``` - -The following example will trigger the type-checker to fail: - -```typescript -const a: string = 42; -``` diff --git a/tests/testdata/test/markdown_full_block_names.out b/tests/testdata/test/markdown_full_block_names.out deleted file mode 100644 index 13051112e..000000000 --- a/tests/testdata/test/markdown_full_block_names.out +++ /dev/null @@ -1,6 +0,0 @@ -Check [WILDCARD]/test/markdown_full_block_names.md$5-8.js -Check [WILDCARD]/test/markdown_full_block_names.md$17-20.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const a: string = 42; - ^ - at [WILDCARD]/test/markdown_full_block_names.md$17-20.ts:1:7 diff --git a/tests/testdata/test/markdown_windows.md b/tests/testdata/test/markdown_windows.md deleted file mode 100644 index d18dbd108..000000000 --- a/tests/testdata/test/markdown_windows.md +++ /dev/null @@ -1,31 +0,0 @@ -# Documentation - -The following block does not have a language attribute and should be ignored: - -``` -This is a fenced block without attributes, it's invalid and it should be ignored. -``` - -The following block should be given a js extension on extraction: - -```js -console.log("js"); -``` - -The following block should be given a ts extension on extraction: - -```ts -console.log("ts"); -``` - -The following example contains the ignore attribute and will be ignored: - -```ts ignore -const value: Invalid = "ignored"; -``` - -The following example will trigger the type-checker to fail: - -```ts -const a: string = 42; -``` diff --git a/tests/testdata/test/markdown_windows.out b/tests/testdata/test/markdown_windows.out deleted file mode 100644 index 4810e50cd..000000000 --- a/tests/testdata/test/markdown_windows.out +++ /dev/null @@ -1,7 +0,0 @@ -Check [WILDCARD]/test/markdown_windows.md$11-14.js -Check [WILDCARD]/test/markdown_windows.md$17-20.ts -Check [WILDCARD]/test/markdown_windows.md$29-32.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const a: string = 42; - ^ - at [WILDCARD]/test/markdown_windows.md$29-32.ts:1:7 diff --git a/tests/testdata/test/markdown_with_comment.md b/tests/testdata/test/markdown_with_comment.md deleted file mode 100644 index 886e88103..000000000 --- a/tests/testdata/test/markdown_with_comment.md +++ /dev/null @@ -1,36 +0,0 @@ -# Documentation - -The following examples are inside HTML comments and will not trigger the -type-checker: - -<!-- ```ts ignore -const value: Invalid = "ignored"; -``` --> - -<!-- -```ts -const a: string = 42; -``` ---> - -<!-- - -This is a comment. - -```ts -const a: string = 42; -``` - -Something something more comments. - -```typescript -const a: boolean = "true"; -``` - ---> - -The following example will trigger the type-checker to fail: - -```ts -const a: string = 42; -``` diff --git a/tests/testdata/test/markdown_with_comment.out b/tests/testdata/test/markdown_with_comment.out deleted file mode 100644 index b202919d8..000000000 --- a/tests/testdata/test/markdown_with_comment.out +++ /dev/null @@ -1,5 +0,0 @@ -Check [WILDCARD]/test/markdown_with_comment.md$34-37.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const a: string = 42; - ^ - at [WILDCARD]/test/markdown_with_comment.md$34-37.ts:1:7 diff --git a/tests/testdata/test/meta.out b/tests/testdata/test/meta.out deleted file mode 100644 index c46315ece..000000000 --- a/tests/testdata/test/meta.out +++ /dev/null @@ -1,11 +0,0 @@ -Check [WILDCARD]/test/meta.ts -running 1 test from ./test/meta.ts -check values ... -------- output ------- -import.meta.main: false -import.meta.url: [WILDCARD]/test/meta.ts ------ output end ----- -check values ... ok ([WILDCARD]) - -ok | 1 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/meta.ts b/tests/testdata/test/meta.ts deleted file mode 100644 index f2433a96d..000000000 --- a/tests/testdata/test/meta.ts +++ /dev/null @@ -1,7 +0,0 @@ -const main = import.meta.main; -const url = import.meta.url; - -Deno.test("check values", () => { - console.log("import.meta.main: %s", main); - console.log("import.meta.url: %s", url); -}); diff --git a/tests/testdata/test/nested_failures.junit.out b/tests/testdata/test/nested_failures.junit.out deleted file mode 100644 index 3e4d3c0d4..000000000 --- a/tests/testdata/test/nested_failures.junit.out +++ /dev/null @@ -1,47 +0,0 @@ -Check file:///[WILDCARD]/test/nested_failures.ts -<?xml version="1.0" encoding="UTF-8"?> -<testsuites name="deno test" tests="11" failures="6" errors="0" time="[WILDCARD]"> - <testsuite name="./test/nested_failures.ts" tests="11" disabled="0" errors="0" failures="6"> - <testcase name="parent 1" classname="./test/nested_failures.ts" time="[WILDCARD]" line="1" col="6"> - <failure message="1 test step failed">1 test step failed.</failure> - </testcase> - <testcase name="parent 2" classname="./test/nested_failures.ts" time="[WILDCARD]" line="8" col="6"> - <failure message="2 test steps failed">2 test steps failed.</failure> - </testcase> - <testcase name="parent 3" classname="./test/nested_failures.ts" time="[WILDCARD]" line="20" col="6"> - </testcase> - <testcase name="parent 1 > child 1" classname="./test/nested_failures.ts" time="[WILDCARD]" line="2" col="11"> - </testcase> - <testcase name="parent 1 > child 2" classname="./test/nested_failures.ts" time="[WILDCARD]" line="3" col="11"> - <failure message="Uncaught Error: Fail.">Error: Fail. - throw new Error("Fail."); - ^ - at file:///[WILDCARD]/test/nested_failures.ts:4:11 - [WILDCARD]</failure> - </testcase> - <testcase name="parent 2 > child 1" classname="./test/nested_failures.ts" time="[WILDCARD]" line="9" col="11"> - <failure message="1 test step failed">1 test step failed.</failure> - </testcase> - <testcase name="parent 2 > child 1 > grandchild 1" classname="[WILDCARD]/test/nested_failures.ts" time="[WILDCARD]" line="10" col="13"> - </testcase> - <testcase name="parent 2 > child 1 > grandchild 2" classname="[WILDCARD]/test/nested_failures.ts" time="[WILDCARD]" line="11" col="13"> - <failure message="Uncaught Error: Fail.">Error: Fail. - throw new Error("Fail."); - ^ - at file:///[WILDCARD]/test/nested_failures.ts:12:13 - [WILDCARD]</failure> - </testcase> - <testcase name="parent 2 > child 2" classname="./test/nested_failures.ts" time="[WILDCARD]" line="15" col="11"> - <failure message="Uncaught Error: Fail.">Error: Fail. - throw new Error("Fail."); - ^ - at file:///[WILDCARD]/test/nested_failures.ts:16:11 - [WILDCARD]</failure> - </testcase> - <testcase name="parent 3 > child 1" classname="./test/nested_failures.ts" time="[WILDCARD]" line="21" col="11"> - </testcase> - <testcase name="parent 3 > child 2" classname="./test/nested_failures.ts" time="[WILDCARD]" line="22" col="11"> - </testcase> - </testsuite> -</testsuites> -error: Test failed diff --git a/tests/testdata/test/nested_failures.ts b/tests/testdata/test/nested_failures.ts deleted file mode 100644 index 128e48aef..000000000 --- a/tests/testdata/test/nested_failures.ts +++ /dev/null @@ -1,23 +0,0 @@ -Deno.test("parent 1", async (t) => { - await t.step("child 1", () => {}); - await t.step("child 2", () => { - throw new Error("Fail."); - }); -}); - -Deno.test("parent 2", async (t) => { - await t.step("child 1", async (t) => { - await t.step("grandchild 1", () => {}); - await t.step("grandchild 2", () => { - throw new Error("Fail."); - }); - }); - await t.step("child 2", () => { - throw new Error("Fail."); - }); -}); - -Deno.test("parent 3", async (t) => { - await t.step("child 1", () => {}); - await t.step("child 2", () => {}); -}); diff --git a/tests/testdata/test/no_check.out b/tests/testdata/test/no_check.out deleted file mode 100644 index 66ad07e26..000000000 --- a/tests/testdata/test/no_check.out +++ /dev/null @@ -1,19 +0,0 @@ -Uncaught error from ./test/no_check.ts FAILED - - ERRORS - -./test/no_check.ts (uncaught error) -error: (in promise) TypeError: Cannot read properties of undefined (reading 'fn') -Deno.test(); - ^ - at [WILDCARD] -This error was not caught from a test and caused the test runner to fail on the referenced module. -It most likely originated from a dangling promise, event/timeout handler or top-level code. - - FAILURES - -./test/no_check.ts (uncaught error) - -FAILED | 0 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/no_check.ts b/tests/testdata/test/no_check.ts deleted file mode 100644 index 79d75f989..000000000 --- a/tests/testdata/test/no_check.ts +++ /dev/null @@ -1 +0,0 @@ -Deno.test(); diff --git a/tests/testdata/test/no_color.ts b/tests/testdata/test/no_color.ts deleted file mode 100644 index 38c531ee9..000000000 --- a/tests/testdata/test/no_color.ts +++ /dev/null @@ -1,17 +0,0 @@ -Deno.test({ - name: "success", - fn() {}, -}); - -Deno.test({ - name: "fail", - fn() { - throw new Error("fail"); - }, -}); - -Deno.test({ - name: "ignored", - ignore: true, - fn() {}, -}); diff --git a/tests/testdata/test/no_prompt_by_default.out b/tests/testdata/test/no_prompt_by_default.out deleted file mode 100644 index cd40fab53..000000000 --- a/tests/testdata/test/no_prompt_by_default.out +++ /dev/null @@ -1,16 +0,0 @@ -running 1 test from ./test/no_prompt_by_default.ts -no prompt ... FAILED ([WILDCARD]s) - - ERRORS - -no prompt => ./test/no_prompt_by_default.ts:[WILDCARD] -error: NotCapable: Requires read access to "./some_file.txt", run again with the --allow-read flag -[WILDCARD] - - FAILURES - -no prompt => ./test/no_prompt_by_default.ts:[WILDCARD] - -FAILED | 0 passed | 1 failed ([WILDCARD]s) - -error: Test failed diff --git a/tests/testdata/test/no_prompt_by_default.ts b/tests/testdata/test/no_prompt_by_default.ts deleted file mode 100644 index 83837825d..000000000 --- a/tests/testdata/test/no_prompt_by_default.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.test("no prompt", async () => { - await Deno.readTextFile("./some_file.txt"); -}); diff --git a/tests/testdata/test/no_prompt_with_denied_perms.out b/tests/testdata/test/no_prompt_with_denied_perms.out deleted file mode 100644 index f6c8ec826..000000000 --- a/tests/testdata/test/no_prompt_with_denied_perms.out +++ /dev/null @@ -1,16 +0,0 @@ -running 1 test from ./test/no_prompt_with_denied_perms.ts -no prompt ... FAILED ([WILDCARD]s) - - ERRORS - -no prompt => ./test/no_prompt_with_denied_perms.ts:[WILDCARD] -error: NotCapable: Requires read access to "./some_file.txt", run again with the --allow-read flag -[WILDCARD] - - FAILURES - -no prompt => ./test/no_prompt_with_denied_perms.ts:[WILDCARD] - -FAILED | 0 passed | 1 failed ([WILDCARD]s) - -error: Test failed diff --git a/tests/testdata/test/no_prompt_with_denied_perms.ts b/tests/testdata/test/no_prompt_with_denied_perms.ts deleted file mode 100644 index 7fe5577cb..000000000 --- a/tests/testdata/test/no_prompt_with_denied_perms.ts +++ /dev/null @@ -1,3 +0,0 @@ -Deno.test("no prompt", { permissions: { read: false } }, async () => { - await Deno.readTextFile("./some_file.txt"); -}); diff --git a/tests/testdata/test/no_run.out b/tests/testdata/test/no_run.out deleted file mode 100644 index 5edf03fe0..000000000 --- a/tests/testdata/test/no_run.out +++ /dev/null @@ -1,5 +0,0 @@ -Check [WILDCARD]/test/no_run.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const _value: string = 1; - ~~~~~~ - at [WILDCARD]/test/no_run.ts:1:7 diff --git a/tests/testdata/test/no_run.ts b/tests/testdata/test/no_run.ts deleted file mode 100644 index b75915753..000000000 --- a/tests/testdata/test/no_run.ts +++ /dev/null @@ -1 +0,0 @@ -const _value: string = 1; diff --git a/tests/testdata/test/non_error_thrown.out b/tests/testdata/test/non_error_thrown.out deleted file mode 100644 index 6755f2905..000000000 --- a/tests/testdata/test/non_error_thrown.out +++ /dev/null @@ -1,40 +0,0 @@ -running 6 tests from [WILDCARD]/non_error_thrown.ts -foo ... FAILED ([WILDCARD]) -bar ... FAILED ([WILDCARD]) -baz ... FAILED ([WILDCARD]) -qux ... FAILED ([WILDCARD]) -quux ... FAILED ([WILDCARD]) -quuz ... FAILED ([WILDCARD]) - - ERRORS - -foo => [WILDCARD]/non_error_thrown.ts:1:6 -error: undefined - -bar => [WILDCARD]/non_error_thrown.ts:5:6 -error: null - -baz => [WILDCARD]/non_error_thrown.ts:9:6 -error: 123 - -qux => [WILDCARD]/non_error_thrown.ts:13:6 -error: "Hello, world!" - -quux => [WILDCARD]/non_error_thrown.ts:17:6 -error: [ 1, 2, 3 ] - -quuz => [WILDCARD]/non_error_thrown.ts:21:6 -error: { a: "Hello, world!", b: [ 1, 2, 3 ] } - - FAILURES - -foo => [WILDCARD]/non_error_thrown.ts:1:6 -bar => [WILDCARD]/non_error_thrown.ts:5:6 -baz => [WILDCARD]/non_error_thrown.ts:9:6 -qux => [WILDCARD]/non_error_thrown.ts:13:6 -quux => [WILDCARD]/non_error_thrown.ts:17:6 -quuz => [WILDCARD]/non_error_thrown.ts:21:6 - -FAILED | 0 passed | 6 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/non_error_thrown.ts b/tests/testdata/test/non_error_thrown.ts deleted file mode 100644 index 85dc8d179..000000000 --- a/tests/testdata/test/non_error_thrown.ts +++ /dev/null @@ -1,23 +0,0 @@ -Deno.test("foo", () => { - throw undefined; -}); - -Deno.test("bar", () => { - throw null; -}); - -Deno.test("baz", () => { - throw 123; -}); - -Deno.test("qux", () => { - throw "Hello, world!"; -}); - -Deno.test("quux", () => { - throw [1, 2, 3]; -}); - -Deno.test("quuz", () => { - throw { a: "Hello, world!", b: [1, 2, 3] }; -}); diff --git a/tests/testdata/test/only.out b/tests/testdata/test/only.out deleted file mode 100644 index 2e66ed22b..000000000 --- a/tests/testdata/test/only.out +++ /dev/null @@ -1,8 +0,0 @@ -Check [WILDCARD]/test/only.ts -running 2 tests from ./test/only.ts -only ... ok ([WILDCARD]) -only2 ... ok ([WILDCARD]) - -ok | 2 passed | 0 failed | 2 filtered out ([WILDCARD]) - -error: Test failed because the "only" option was used diff --git a/tests/testdata/test/only.ts b/tests/testdata/test/only.ts deleted file mode 100644 index 26b4cd425..000000000 --- a/tests/testdata/test/only.ts +++ /dev/null @@ -1,20 +0,0 @@ -Deno.test({ - name: "before", - fn() {}, -}); - -Deno.test({ - only: true, - name: "only", - fn() {}, -}); - -Deno.test.only({ - name: "only2", - fn() {}, -}); - -Deno.test({ - name: "after", - fn() {}, -}); diff --git a/tests/testdata/test/overloads.out b/tests/testdata/test/overloads.out deleted file mode 100644 index 87a3f07cb..000000000 --- a/tests/testdata/test/overloads.out +++ /dev/null @@ -1,11 +0,0 @@ -Check [WILDCARD]/test/overloads.ts -running 6 tests from ./test/overloads.ts -test0 ... ok ([WILDCARD]) -test1 ... ok ([WILDCARD]) -test2 ... ok ([WILDCARD]) -test3 ... ok ([WILDCARD]) -test4 ... ok ([WILDCARD]) -test5 ... ignored ([WILDCARD]) - -ok | 5 passed | 0 failed | 1 ignored ([WILDCARD]) - diff --git a/tests/testdata/test/overloads.ts b/tests/testdata/test/overloads.ts deleted file mode 100644 index eb7b3dccc..000000000 --- a/tests/testdata/test/overloads.ts +++ /dev/null @@ -1,6 +0,0 @@ -Deno.test("test0", () => {}); -Deno.test(function test1() {}); -Deno.test({ name: "test2", fn: () => {} }); -Deno.test("test3", { permissions: "none" }, () => {}); -Deno.test({ name: "test4" }, () => {}); -Deno.test({ ignore: true }, function test5() {}); diff --git a/tests/testdata/test/parallel_output.out b/tests/testdata/test/parallel_output.out deleted file mode 100644 index d3528a6e0..000000000 --- a/tests/testdata/test/parallel_output.out +++ /dev/null @@ -1,56 +0,0 @@ -Check [WILDCARD]/test/parallel_output.ts -./test/parallel_output.ts => step output ... step 1 ... ok ([WILDCARD]s) -./test/parallel_output.ts => step output ... step 2 ... ok ([WILDCARD]s) -------- output ------- -Hello, world! (from step 3) ------ output end ----- -./test/parallel_output.ts => step output ... step 3 ... ok ([WILDCARD]s) -------- output ------- -Hello, world! (from step 4) ------ output end ----- -./test/parallel_output.ts => step output ... step 4 ... ok ([WILDCARD]s) -./test/parallel_output.ts => step output ... ok ([WILDCARD]s) -./test/parallel_output.ts => step failures ... step 1 ... ok ([WILDCARD]s) -./test/parallel_output.ts => step failures ... step 2 ... FAILED ([WILDCARD]s) -./test/parallel_output.ts => step failures ... step 3 ... FAILED ([WILDCARD]s) -./test/parallel_output.ts => step failures ... FAILED (due to 2 failed steps) ([WILDCARD]s) -./test/parallel_output.ts => step nested failure ... step 1 ... inner 1 ... ok ([WILDCARD]s) -./test/parallel_output.ts => step nested failure ... step 1 ... inner 2 ... FAILED ([WILDCARD]s) -./test/parallel_output.ts => step nested failure ... step 1 ... FAILED (due to 1 failed step) ([WILDCARD]s) -./test/parallel_output.ts => step nested failure ... FAILED (due to 1 failed step) ([WILDCARD]s) - - ERRORS - -step failures ... step 2 => ./test/parallel_output.ts:14:11 -error: Error: Fail. - throw new Error("Fail."); - ^ - at file:///[WILDCARD]/test/parallel_output.ts:15:11 - at [WILDCARD] - at file:///[WILDCARD]/test/parallel_output.ts:14:11 - -step failures ... step 3 => ./test/parallel_output.ts:17:11 -error: Error: Fail. - await t.step("step 3", () => Promise.reject(new Error("Fail."))); - ^ - at file:///[WILDCARD]/test/parallel_output.ts:17:47 - at [WILDCARD] - at file:///[WILDCARD]/test/parallel_output.ts:17:11 - -step nested failure ... step 1 ... inner 2 => ./test/parallel_output.ts:23:13 -error: Error: Failed. - throw new Error("Failed."); - ^ - at file:///[WILDCARD]/test/parallel_output.ts:24:13 - at [WILDCARD] - at file:///[WILDCARD]/test/parallel_output.ts:23:13 - - FAILURES - -step failures ... step 2 => ./test/parallel_output.ts:14:11 -step failures ... step 3 => ./test/parallel_output.ts:17:11 -step nested failure ... step 1 ... inner 2 => ./test/parallel_output.ts:23:13 - -FAILED | 1 passed (6 steps) | 2 failed (4 steps) ([WILDCARD]s) - -error: Test failed diff --git a/tests/testdata/test/parallel_output.ts b/tests/testdata/test/parallel_output.ts deleted file mode 100644 index 5de733aad..000000000 --- a/tests/testdata/test/parallel_output.ts +++ /dev/null @@ -1,27 +0,0 @@ -Deno.test("step output", async (t) => { - await t.step("step 1", () => {}); - await t.step("step 2", () => {}); - await t.step("step 3", () => { - console.log("Hello, world! (from step 3)"); - }); - await t.step("step 4", () => { - console.log("Hello, world! (from step 4)"); - }); -}); - -Deno.test("step failures", async (t) => { - await t.step("step 1", () => {}); - await t.step("step 2", () => { - throw new Error("Fail."); - }); - await t.step("step 3", () => Promise.reject(new Error("Fail."))); -}); - -Deno.test("step nested failure", async (t) => { - await t.step("step 1", async (t) => { - await t.step("inner 1", () => {}); - await t.step("inner 2", () => { - throw new Error("Failed."); - }); - }); -}); diff --git a/tests/testdata/test/pass.junit.out b/tests/testdata/test/pass.junit.out deleted file mode 100644 index af9fd6f6b..000000000 --- a/tests/testdata/test/pass.junit.out +++ /dev/null @@ -1,38 +0,0 @@ -Check file:///[WILDCARD]/test/pass.ts -<?xml version="1.0" encoding="UTF-8"?> -<testsuites name="deno test" tests="16" failures="0" errors="0" time="[WILDCARD]"> - <testsuite name="./test/pass.ts" tests="16" disabled="0" errors="0" failures="0"> - <testcase name="test 0" classname="./test/pass.ts" time="[WILDCARD]" line="1" col="6"> - </testcase> - <testcase name="test 1" classname="./test/pass.ts" time="[WILDCARD]" line="2" col="6"> - </testcase> - <testcase name="test 2" classname="./test/pass.ts" time="[WILDCARD]" line="3" col="6"> - </testcase> - <testcase name="test 3" classname="./test/pass.ts" time="[WILDCARD]" line="4" col="6"> - </testcase> - <testcase name="test 4" classname="./test/pass.ts" time="[WILDCARD]" line="5" col="6"> - </testcase> - <testcase name="test 5" classname="./test/pass.ts" time="[WILDCARD]" line="6" col="6"> - </testcase> - <testcase name="test 6" classname="./test/pass.ts" time="[WILDCARD]" line="7" col="6"> - </testcase> - <testcase name="test 7" classname="./test/pass.ts" time="[WILDCARD]" line="8" col="6"> - </testcase> - <testcase name="test 8" classname="./test/pass.ts" time="[WILDCARD]" line="9" col="6"> - </testcase> - <testcase name="test 9" classname="./test/pass.ts" time="[WILDCARD]" line="12" col="6"> - </testcase> - <testcase name="test\b" classname="./test/pass.ts" time="[WILDCARD]" line="16" col="6"> - </testcase> - <testcase name="test\f" classname="./test/pass.ts" time="[WILDCARD]" line="19" col="6"> - </testcase> - <testcase name="test\t" classname="./test/pass.ts" time="[WILDCARD]" line="23" col="6"> - </testcase> - <testcase name="test\n" classname="./test/pass.ts" time="[WILDCARD]" line="27" col="6"> - </testcase> - <testcase name="test\r" classname="./test/pass.ts" time="[WILDCARD]" line="31" col="6"> - </testcase> - <testcase name="test\v" classname="./test/pass.ts" time="[WILDCARD]" line="35" col="6"> - </testcase> - </testsuite> -</testsuites> diff --git a/tests/testdata/test/pass.out b/tests/testdata/test/pass.out deleted file mode 100644 index 08b9f5a52..000000000 --- a/tests/testdata/test/pass.out +++ /dev/null @@ -1,53 +0,0 @@ -Check [WILDCARD]/test/pass.ts -running 16 tests from ./test/pass.ts -test 0 ... ok ([WILDCARD]) -test 1 ... ok ([WILDCARD]) -test 2 ... ok ([WILDCARD]) -test 3 ... ok ([WILDCARD]) -test 4 ... ok ([WILDCARD]) -test 5 ... ok ([WILDCARD]) -test 6 ... ok ([WILDCARD]) -test 7 ... ok ([WILDCARD]) -test 8 ... -------- output ------- -console.log ------ output end ----- -test 8 ... ok ([WILDCARD]) -test 9 ... -------- output ------- -console.error ------ output end ----- -test 9 ... ok ([WILDCARD]) -test\b ... -------- output ------- -console.error ------ output end ----- -test\b ... ok ([WILDCARD]) -test\f ... -------- output ------- -console.error ------ output end ----- -test\f ... ok ([WILDCARD]) -test\t ... -------- output ------- -console.error ------ output end ----- -test\t ... ok ([WILDCARD]) -test\n ... -------- output ------- -console.error ------ output end ----- -test\n ... ok ([WILDCARD]) -test\r ... -------- output ------- -console.error ------ output end ----- -test\r ... ok ([WILDCARD]) -test\v ... -------- output ------- -console.error ------ output end ----- -test\v ... ok ([WILDCARD]) - -ok | 16 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/pass.ts b/tests/testdata/test/pass.ts deleted file mode 100644 index c4c0f45dc..000000000 --- a/tests/testdata/test/pass.ts +++ /dev/null @@ -1,37 +0,0 @@ -Deno.test("test 0", () => {}); -Deno.test("test 1", () => {}); -Deno.test("test 2", () => {}); -Deno.test("test 3", () => {}); -Deno.test("test 4", () => {}); -Deno.test("test 5", () => {}); -Deno.test("test 6", () => {}); -Deno.test("test 7", () => {}); -Deno.test("test 8", () => { - console.log("console.log"); -}); -Deno.test("test 9", () => { - console.error("console.error"); -}); - -Deno.test("test\b", () => { - console.error("console.error"); -}); -Deno.test("test\f", () => { - console.error("console.error"); -}); - -Deno.test("test\t", () => { - console.error("console.error"); -}); - -Deno.test("test\n", () => { - console.error("console.error"); -}); - -Deno.test("test\r", () => { - console.error("console.error"); -}); - -Deno.test("test\v", () => { - console.error("console.error"); -}); diff --git a/tests/testdata/test/quiet.out b/tests/testdata/test/quiet.out deleted file mode 100644 index 83dbe6ba9..000000000 --- a/tests/testdata/test/quiet.out +++ /dev/null @@ -1,8 +0,0 @@ -running 4 tests from ./test/quiet.ts -console.log ... ok ([WILDCARD]) -console.error ... ok ([WILDCARD]) -console.info ... ok ([WILDCARD]) -console.warn ... ok ([WILDCARD]) - -ok | 4 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/quiet.ts b/tests/testdata/test/quiet.ts deleted file mode 100644 index f40805bfb..000000000 --- a/tests/testdata/test/quiet.ts +++ /dev/null @@ -1,15 +0,0 @@ -Deno.test("console.log", function () { - console.log("log"); -}); - -Deno.test("console.error", function () { - console.error("error"); -}); - -Deno.test("console.info", function () { - console.info("info"); -}); - -Deno.test("console.warn", function () { - console.info("warn"); -}); diff --git a/tests/testdata/test/recursive_permissions_pledge.js b/tests/testdata/test/recursive_permissions_pledge.js deleted file mode 100644 index 9bf320c37..000000000 --- a/tests/testdata/test/recursive_permissions_pledge.js +++ /dev/null @@ -1,6 +0,0 @@ -Deno[Deno.internal].core.ops.op_pledge_test_permissions( - "none", -); -Deno[Deno.internal].core.ops.op_pledge_test_permissions( - "inherit", -); diff --git a/tests/testdata/test/replace_timers.js b/tests/testdata/test/replace_timers.js deleted file mode 100644 index 692f1d671..000000000 --- a/tests/testdata/test/replace_timers.js +++ /dev/null @@ -1,7 +0,0 @@ -Deno.test("foo", async (t) => { - globalThis.setTimeout = () => {}; - globalThis.clearTimeout = () => {}; - globalThis.setInterval = () => {}; - globalThis.clearInterval = () => {}; - await t.step("bar", () => {}); -}); diff --git a/tests/testdata/test/replace_timers.js.out b/tests/testdata/test/replace_timers.js.out deleted file mode 100644 index 81beb5ebe..000000000 --- a/tests/testdata/test/replace_timers.js.out +++ /dev/null @@ -1,7 +0,0 @@ -running 1 test from ./test/replace_timers.js -foo ... - bar ... ok ([WILDCARD]) -foo ... ok ([WILDCARD]) - -ok | 1 passed (1 step) | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/report_error.out b/tests/testdata/test/report_error.out deleted file mode 100644 index 698550f97..000000000 --- a/tests/testdata/test/report_error.out +++ /dev/null @@ -1,23 +0,0 @@ -running 2 tests from [WILDCARD]/report_error.ts -foo ... -Uncaught error from [WILDCARD]/report_error.ts FAILED -foo ... cancelled (0ms) -bar ... cancelled (0ms) - - ERRORS - -[WILDCARD]/report_error.ts (uncaught error) -error: Error: foo - reportError(new Error("foo")); - ^ - at [WILDCARD]/report_error.ts:2:15 -This error was not caught from a test and caused the test runner to fail on the referenced module. -It most likely originated from a dangling promise, event/timeout handler or top-level code. - - FAILURES - -[WILDCARD]/report_error.ts (uncaught error) - -FAILED | 0 passed | 3 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/report_error.ts b/tests/testdata/test/report_error.ts deleted file mode 100644 index 56b6db26c..000000000 --- a/tests/testdata/test/report_error.ts +++ /dev/null @@ -1,6 +0,0 @@ -Deno.test("foo", () => { - reportError(new Error("foo")); - console.log(1); -}); - -Deno.test("bar", () => {}); diff --git a/tests/testdata/test/sanitizer/exit_sanitizer.out b/tests/testdata/test/sanitizer/exit_sanitizer.out deleted file mode 100644 index 305d51cc8..000000000 --- a/tests/testdata/test/sanitizer/exit_sanitizer.out +++ /dev/null @@ -1,38 +0,0 @@ -Check [WILDCARD]/exit_sanitizer.ts -running 3 tests from [WILDCARD]/exit_sanitizer.ts -exit(0) ... FAILED ([WILDCARD]) -exit(1) ... FAILED ([WILDCARD]) -exit(2) ... FAILED ([WILDCARD]) - - ERRORS - -exit(0) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD] -error: Error: Test case attempted to exit with exit code: 0 - Deno.exit(0); - ^ - at [WILDCARD] - at [WILDCARD]/exit_sanitizer.ts:2:8 - -exit(1) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD] -error: Error: Test case attempted to exit with exit code: 1 - Deno.exit(1); - ^ - at [WILDCARD] - at [WILDCARD]/exit_sanitizer.ts:6:8 - -exit(2) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD] -error: Error: Test case attempted to exit with exit code: 2 - Deno.exit(2); - ^ - at [WILDCARD] - at [WILDCARD]/exit_sanitizer.ts:10:8 - - FAILURES - -exit(0) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD] -exit(1) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD] -exit(2) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD] - -FAILED | 0 passed | 3 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/sanitizer/exit_sanitizer.ts b/tests/testdata/test/sanitizer/exit_sanitizer.ts deleted file mode 100644 index 186406a9d..000000000 --- a/tests/testdata/test/sanitizer/exit_sanitizer.ts +++ /dev/null @@ -1,11 +0,0 @@ -Deno.test("exit(0)", function () { - Deno.exit(0); -}); - -Deno.test("exit(1)", function () { - Deno.exit(1); -}); - -Deno.test("exit(2)", function () { - Deno.exit(2); -}); diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.out b/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.out deleted file mode 100644 index ffccd8422..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.out +++ /dev/null @@ -1,19 +0,0 @@ -Check [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts -running 1 test from [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts -test 1 ... FAILED [WILDCARD] - - ERRORS - -test 1 => [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts:[WILDCARD] -error: Leaks detected: - - A timer was started before the test, but completed during the test. Intervals and timers should not complete in a test if they were not started in that test. This is often caused by not calling `clearTimeout`. The operation was started here: - at [WILDCARD] - at [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts:[WILDCARD] - - FAILURES - -test 1 => [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts:[WILDCARD] - -FAILED | 0 passed | 1 failed [WILDCARD] - -error: Test failed diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.ts b/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.ts deleted file mode 100644 index 97d3d72c8..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.ts +++ /dev/null @@ -1,5 +0,0 @@ -const timer = setTimeout(() => {}, 10000000000); - -Deno.test("test 1", () => { - clearTimeout(timer); -}); diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.out b/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.out deleted file mode 100644 index 38d7fbb52..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.out +++ /dev/null @@ -1,45 +0,0 @@ -Check [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts -running 2 tests from [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts -test 1 ... FAILED ([WILDCARD]) -test 2 ... FAILED ([WILDCARD]) - - ERRORS - -test 1 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] -error: Leaks detected: - - A timer was started in this test, but never completed. This is often caused by not calling `clearTimeout`. The operation was started here: - at [WILDCARD] - at setTimeout ([WILDCARD]) - at test ([WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]) - at [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:8:27 - at [WILDCARD] - - A timer was started in this test, but never completed. This is often caused by not calling `clearTimeout`. The operation was started here: - at [WILDCARD] - at setTimeout ([WILDCARD]) - at test ([WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]) - at [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:8:27 - at [WILDCARD] - -test 2 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] -error: Leaks detected: - - A timer was started in this test, but never completed. This is often caused by not calling `clearTimeout`. The operation was started here: - at [WILDCARD] - at setTimeout ([WILDCARD]) - at test ([WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]) - at [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:10:27 - at [WILDCARD] - - A timer was started in this test, but never completed. This is often caused by not calling `clearTimeout`. The operation was started here: - at [WILDCARD] - at setTimeout ([WILDCARD]) - at test ([WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]) - at [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:10:27 - at [WILDCARD] - - FAILURES - -test 1 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] -test 2 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] - -FAILED | 0 passed | 2 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.ts b/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.ts deleted file mode 100644 index 1f52d481f..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -// https://github.com/denoland/deno/issues/8965 - -function test() { - setTimeout(() => {}, 10000); - setTimeout(() => {}, 10001); -} - -Deno.test("test 1", () => test()); - -Deno.test("test 2", () => test()); diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests_no_trace.out b/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests_no_trace.out deleted file mode 100644 index c87cd0025..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests_no_trace.out +++ /dev/null @@ -1,25 +0,0 @@ -Check [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts -running 2 tests from [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts -test 1 ... FAILED ([WILDCARD]) -test 2 ... FAILED ([WILDCARD]) - - ERRORS - -test 1 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] -error: Leaks detected: - - 2 timers were started in this test, but never completed. This is often caused by not calling `clearTimeout`. -To get more details where leaks occurred, run again with the --trace-leaks flag. - -test 2 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] -error: Leaks detected: - - 2 timers were started in this test, but never completed. This is often caused by not calling `clearTimeout`. -To get more details where leaks occurred, run again with the --trace-leaks flag. - - FAILURES - -test 1 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] -test 2 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] - -FAILED | 0 passed | 2 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.out b/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.out deleted file mode 100644 index 407699b6a..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.out +++ /dev/null @@ -1,6 +0,0 @@ -running 2 tests from [WILDCARD]/ops_sanitizer_nexttick.ts -test 1 ... ok ([WILDCARD]) -test 2 ... ok ([WILDCARD]) - -ok | 2 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.ts b/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.ts deleted file mode 100644 index 9ad3a7b28..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { nextTick } from "node:process"; - -// https://github.com/denoland/deno_std/issues/1651 - -Deno.test("test 1", async () => { - await new Promise<void>((resolve) => nextTick(resolve)); -}); - -Deno.test("test 2", async () => { - await new Promise<void>((resolve) => nextTick(resolve)); -}); diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.out b/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.out deleted file mode 100644 index be88a6e1d..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.out +++ /dev/null @@ -1,10 +0,0 @@ -Check [WILDCARD]/ops_sanitizer_step_leak.ts -running 1 test from [WILDCARD]/ops_sanitizer_step_leak.ts -timeout ... - step ... ok [WILDCARD] -------- output ------- -done ------ output end ----- -timeout ... ok [WILDCARD] - -ok | 1 passed (1 step) | 0 failed [WILDCARD]
\ No newline at end of file diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.ts b/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.ts deleted file mode 100644 index 3fb9b397e..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.ts +++ /dev/null @@ -1,10 +0,0 @@ -Deno.test("timeout", async (t) => { - const timer = setTimeout(() => { - console.log("timeout"); - }, 10000); - clearTimeout(timer); - await t.step("step", async () => { - await new Promise<void>((resolve) => setTimeout(() => resolve(), 10)); - }); - console.log("done"); -}); diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_tcp.out b/tests/testdata/test/sanitizer/ops_sanitizer_tcp.out deleted file mode 100644 index 7b5660379..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_tcp.out +++ /dev/null @@ -1,24 +0,0 @@ -Check [WILDCARD]/ops_sanitizer_tcp.ts -running 1 test from [WILDCARD]/ops_sanitizer_tcp.ts -testLeakTcpOps ... FAILED ([WILDCARD]) - - ERRORS - -testLeakTcpOps => [WILDCARD]/ops_sanitizer_tcp.ts:[WILDCARD] -error: Leaks detected: - - A TCP listener was opened during the test, but not closed during the test. Close the TCP listener by calling `tcpListener.close()`. - - An async operation to accept a TCP stream was started in this test, but never completed. This is often caused by not closing a `Deno.Listener`. The operation was started here: - at op_net_accept_tcp ([WILDCARD]) - at Listener.accept ([WILDCARD]) - at testLeakTcpOps ([WILDCARD]) - at innerWrapped ([WILDCARD]) - at exitSanitizer ([WILDCARD]) - at outerWrapped ([WILDCARD]) - - FAILURES - -testLeakTcpOps => [WILDCARD]/ops_sanitizer_tcp.ts:[WILDCARD] - -FAILED | 0 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_tcp.ts b/tests/testdata/test/sanitizer/ops_sanitizer_tcp.ts deleted file mode 100644 index ec2df9fd5..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_tcp.ts +++ /dev/null @@ -1,4 +0,0 @@ -Deno.test(function testLeakTcpOps() { - const listener1 = Deno.listen({ port: 0 }); - listener1.accept(); -}); diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.out b/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.out deleted file mode 100644 index e6e527112..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.out +++ /dev/null @@ -1,6 +0,0 @@ -Check [WILDCARD]/ops_sanitizer_timeout_failure.ts -running 1 test from [WILDCARD]/ops_sanitizer_timeout_failure.ts -wait ... ok ([WILDCARD]) - -ok | 1 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.ts b/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.ts deleted file mode 100644 index d40a5a258..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.ts +++ /dev/null @@ -1,22 +0,0 @@ -let intervalHandle: number; -let firstIntervalPromise: Promise<void>; - -addEventListener("load", () => { - firstIntervalPromise = new Promise((resolve) => { - let firstIntervalCalled = false; - intervalHandle = setInterval(() => { - if (!firstIntervalCalled) { - resolve(); - firstIntervalCalled = true; - } - }, 5); - }); -}); - -addEventListener("unload", () => { - clearInterval(intervalHandle); -}); - -Deno.test("wait", async function () { - await firstIntervalPromise; -}); diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_unstable.out b/tests/testdata/test/sanitizer/ops_sanitizer_unstable.out deleted file mode 100644 index a09f34592..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_unstable.out +++ /dev/null @@ -1,22 +0,0 @@ -Check [WILDCARD]/ops_sanitizer_unstable.ts -running 2 tests from [WILDCARD]/ops_sanitizer_unstable.ts -no-op ... ok ([WILDCARD]) -leak interval ... FAILED ([WILDCARD]) - - ERRORS - -leak interval => [WILDCARD]/ops_sanitizer_unstable.ts:[WILDCARD] -error: Leaks detected: - - An interval was started in this test, but never completed. This is often caused by not calling `clearInterval`. The operation was started here: - at [WILDCARD] - at setInterval ([WILDCARD]) - at fn ([WILDCARD]/ops_sanitizer_unstable.ts:[WILDCARD]) - at [WILDCARD] - - FAILURES - -leak interval => [WILDCARD]/ops_sanitizer_unstable.ts:[WILDCARD] - -FAILED | 1 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_unstable.ts b/tests/testdata/test/sanitizer/ops_sanitizer_unstable.ts deleted file mode 100644 index 1deb1d5a7..000000000 --- a/tests/testdata/test/sanitizer/ops_sanitizer_unstable.ts +++ /dev/null @@ -1,10 +0,0 @@ -Deno.test("no-op", function () {}); -Deno.test({ - name: "leak interval", - // regression test for sanitizer errors being swallowed with permissions. - // https://github.com/denoland/deno/pull/18550 - permissions: {}, - fn() { - setInterval(function () {}, 100000); - }, -}); diff --git a/tests/testdata/test/sanitizer/resource_sanitizer.out b/tests/testdata/test/sanitizer/resource_sanitizer.out deleted file mode 100644 index 128bbc7b6..000000000 --- a/tests/testdata/test/sanitizer/resource_sanitizer.out +++ /dev/null @@ -1,20 +0,0 @@ -Check [WILDCARD]/resource_sanitizer.ts -running 1 test from [WILDCARD]/resource_sanitizer.ts -leak ... FAILED ([WILDCARD]) - - ERRORS - -leak => [WILDCARD]/resource_sanitizer.ts:[WILDCARD] -error: Leaks detected: -[UNORDERED_START] - - The stdin pipe was opened before the test started, but was closed during the test. Do not close resources in a test that were not created during that test. - - A file was opened during the test, but not closed during the test. Close the file handle by calling `file.close()`. -[UNORDERED_END] - - FAILURES - -leak => [WILDCARD]/resource_sanitizer.ts:[WILDCARD] - -FAILED | 0 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/sanitizer/resource_sanitizer.ts b/tests/testdata/test/sanitizer/resource_sanitizer.ts deleted file mode 100644 index 93c9222c5..000000000 --- a/tests/testdata/test/sanitizer/resource_sanitizer.ts +++ /dev/null @@ -1,4 +0,0 @@ -Deno.test("leak", function () { - Deno.openSync("run/001_hello.js"); - Deno.stdin.close(); -}); diff --git a/tests/testdata/test/sanitizer/trace_ops_caught_error/main.out b/tests/testdata/test/sanitizer/trace_ops_caught_error/main.out deleted file mode 100644 index 4e591adf1..000000000 --- a/tests/testdata/test/sanitizer/trace_ops_caught_error/main.out +++ /dev/null @@ -1,6 +0,0 @@ -Check file:///[WILDCARD]/trace_ops_caught_error/main.ts -running 1 test from [WILDCARD]/trace_ops_caught_error/main.ts -handle thrown error in async function ... ok ([WILDCARD]) - -ok | 1 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/sanitizer/trace_ops_caught_error/main.ts b/tests/testdata/test/sanitizer/trace_ops_caught_error/main.ts deleted file mode 100644 index 043018688..000000000 --- a/tests/testdata/test/sanitizer/trace_ops_caught_error/main.ts +++ /dev/null @@ -1,13 +0,0 @@ -// https://github.com/denoland/deno/pull/16970 -Deno.test("handle thrown error in async function", async () => { - const dirPath = Deno.makeTempDirSync(); - const filePath = `${dirPath}/file.txt`; - try { - await Deno.stat(filePath); - } catch { - await Deno.writeTextFile(filePath, ""); - } finally { - await Deno.remove(filePath); - await Deno.remove(dirPath); - } -}); diff --git a/tests/testdata/test/short-pass.out b/tests/testdata/test/short-pass.out deleted file mode 100644 index 3f239de41..000000000 --- a/tests/testdata/test/short-pass.out +++ /dev/null @@ -1,5 +0,0 @@ -Check [WILDCARD]/test/short-pass.ts -./test/short-pass.ts => test ... ok ([WILDCARD]) - -ok | 1 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/short-pass.ts b/tests/testdata/test/short-pass.ts deleted file mode 100644 index 03818ae8d..000000000 --- a/tests/testdata/test/short-pass.ts +++ /dev/null @@ -1 +0,0 @@ -Deno.test("test", () => {}); diff --git a/tests/testdata/test/shuffle.out b/tests/testdata/test/shuffle.out deleted file mode 100644 index 9037ff518..000000000 --- a/tests/testdata/test/shuffle.out +++ /dev/null @@ -1,39 +0,0 @@ -Check [WILDCARD]/test/shuffle/bar_test.ts -Check [WILDCARD]/test/shuffle/baz_test.ts -Check [WILDCARD]/test/shuffle/foo_test.ts -running 10 tests from [WILDCARD]/test/shuffle/foo_test.ts -test 3 ... ok ([WILDCARD]) -test 2 ... ok ([WILDCARD]) -test 7 ... ok ([WILDCARD]) -test 5 ... ok ([WILDCARD]) -test 8 ... ok ([WILDCARD]) -test 0 ... ok ([WILDCARD]) -test 9 ... ok ([WILDCARD]) -test 4 ... ok ([WILDCARD]) -test 6 ... ok ([WILDCARD]) -test 1 ... ok ([WILDCARD]) -running 10 tests from [WILDCARD]/test/shuffle/baz_test.ts -test 3 ... ok ([WILDCARD]) -test 2 ... ok ([WILDCARD]) -test 7 ... ok ([WILDCARD]) -test 5 ... ok ([WILDCARD]) -test 8 ... ok ([WILDCARD]) -test 0 ... ok ([WILDCARD]) -test 9 ... ok ([WILDCARD]) -test 4 ... ok ([WILDCARD]) -test 6 ... ok ([WILDCARD]) -test 1 ... ok ([WILDCARD]) -running 10 tests from [WILDCARD]/test/shuffle/bar_test.ts -test 3 ... ok ([WILDCARD]) -test 2 ... ok ([WILDCARD]) -test 7 ... ok ([WILDCARD]) -test 5 ... ok ([WILDCARD]) -test 8 ... ok ([WILDCARD]) -test 0 ... ok ([WILDCARD]) -test 9 ... ok ([WILDCARD]) -test 4 ... ok ([WILDCARD]) -test 6 ... ok ([WILDCARD]) -test 1 ... ok ([WILDCARD]) - -ok | 30 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/shuffle/bar_test.ts b/tests/testdata/test/shuffle/bar_test.ts deleted file mode 100644 index ca118dc0d..000000000 --- a/tests/testdata/test/shuffle/bar_test.ts +++ /dev/null @@ -1,3 +0,0 @@ -for (let i = 0; i < 10; i++) { - Deno.test(`test ${i}`, () => {}); -} diff --git a/tests/testdata/test/shuffle/baz_test.ts b/tests/testdata/test/shuffle/baz_test.ts deleted file mode 100644 index ca118dc0d..000000000 --- a/tests/testdata/test/shuffle/baz_test.ts +++ /dev/null @@ -1,3 +0,0 @@ -for (let i = 0; i < 10; i++) { - Deno.test(`test ${i}`, () => {}); -} diff --git a/tests/testdata/test/shuffle/foo_test.ts b/tests/testdata/test/shuffle/foo_test.ts deleted file mode 100644 index ca118dc0d..000000000 --- a/tests/testdata/test/shuffle/foo_test.ts +++ /dev/null @@ -1,3 +0,0 @@ -for (let i = 0; i < 10; i++) { - Deno.test(`test ${i}`, () => {}); -} diff --git a/tests/testdata/test/steps/failing_steps.dot.out b/tests/testdata/test/steps/failing_steps.dot.out deleted file mode 100644 index f8ba8d8e6..000000000 --- a/tests/testdata/test/steps/failing_steps.dot.out +++ /dev/null @@ -1,53 +0,0 @@ -! -. -! -! -! -! -! -! -! - - ERRORS - -nested failure ... step 1 ... inner 1 => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Failed. - throw new Error("Failed."); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - -multiple test step failures ... step 1 => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Fail. - throw new Error("Fail."); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - -multiple test step failures ... step 2 => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Fail. - await t.step("step 2", () => Promise.reject(new Error("Fail."))); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - -failing step in failing test ... step 1 => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Fail. - throw new Error("Fail."); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - -failing step in failing test => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Fail test. - throw new Error("Fail test."); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - - FAILURES - -nested failure ... step 1 ... inner 1 => ./test/steps/failing_steps.ts:[WILDCARD] -multiple test step failures ... step 1 => ./test/steps/failing_steps.ts:[WILDCARD] -multiple test step failures ... step 2 => ./test/steps/failing_steps.ts:[WILDCARD] -failing step in failing test ... step 1 => ./test/steps/failing_steps.ts:[WILDCARD] -failing step in failing test => ./test/steps/failing_steps.ts:[WILDCARD] - -FAILED | 0 passed (1 step) | 3 failed (5 steps) ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/steps/failing_steps.out b/tests/testdata/test/steps/failing_steps.out deleted file mode 100644 index 4b717f5cc..000000000 --- a/tests/testdata/test/steps/failing_steps.out +++ /dev/null @@ -1,59 +0,0 @@ -[WILDCARD] -running 3 tests from ./test/steps/failing_steps.ts -nested failure ... - step 1 ... - inner 1 ... FAILED ([WILDCARD]) - inner 2 ... ok ([WILDCARD]) - step 1 ... FAILED (due to 1 failed step) ([WILDCARD]) -nested failure ... FAILED (due to 1 failed step) ([WILDCARD]) -multiple test step failures ... - step 1 ... FAILED ([WILDCARD]) - step 2 ... FAILED ([WILDCARD]) -multiple test step failures ... FAILED (due to 2 failed steps) ([WILDCARD]) -failing step in failing test ... - step 1 ... FAILED ([WILDCARD]) -failing step in failing test ... FAILED ([WILDCARD]) - - ERRORS - -nested failure ... step 1 ... inner 1 => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Failed. - throw new Error("Failed."); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - -multiple test step failures ... step 1 => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Fail. - throw new Error("Fail."); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - -multiple test step failures ... step 2 => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Fail. - await t.step("step 2", () => Promise.reject(new Error("Fail."))); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - -failing step in failing test ... step 1 => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Fail. - throw new Error("Fail."); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - -failing step in failing test => ./test/steps/failing_steps.ts:[WILDCARD] -error: Error: Fail test. - throw new Error("Fail test."); - ^ - at [WILDCARD]/failing_steps.ts:[WILDCARD] - - FAILURES - -nested failure ... step 1 ... inner 1 => ./test/steps/failing_steps.ts:[WILDCARD] -multiple test step failures ... step 1 => ./test/steps/failing_steps.ts:[WILDCARD] -multiple test step failures ... step 2 => ./test/steps/failing_steps.ts:[WILDCARD] -failing step in failing test ... step 1 => ./test/steps/failing_steps.ts:[WILDCARD] -failing step in failing test => ./test/steps/failing_steps.ts:[WILDCARD] - -FAILED | 0 passed (1 step) | 3 failed (5 steps) ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/steps/failing_steps.tap.out b/tests/testdata/test/steps/failing_steps.tap.out deleted file mode 100644 index 11b289f08..000000000 --- a/tests/testdata/test/steps/failing_steps.tap.out +++ /dev/null @@ -1,43 +0,0 @@ -TAP version 14 -# ./test/steps/failing_steps.ts -# Subtest: nested failure - not ok 1 - inner 1 - --- - {"message":"Error: Failed.\n throw new Error(\"Failed.\");\n ^\n at [WILDCARD]/failing_steps.ts:[WILDCARD]\n[WILDCARD]","severity":"fail","at":{"file":"./test/steps/failing_steps.ts","line":[WILDCARD]}} - ... - ok 2 - inner 2 - not ok 3 - step 1 - --- - {"message":"1 test step failed.","severity":"fail","at":{"file":"./test/steps/failing_steps.ts","line":[WILDCARD]}} - ... - 1..3 -not ok 1 - nested failure - --- - {"message":"1 test step failed.","severity":"fail","at":{"file":"./test/steps/failing_steps.ts","line":[WILDCARD]}} - ... -# Subtest: multiple test step failures - not ok 1 - step 1 - --- - {"message":"Error: Fail.\n throw new Error(\"Fail.\");\n ^\n at [WILDCARD]/failing_steps.ts:[WILDCARD]\n[WILDCARD]","severity":"fail","at":{"file":"./test/steps/failing_steps.ts","line":[WILDCARD]}} - ... - not ok 2 - step 2 - --- - {"message":"Error: Fail.\n await t.step(\"step 2\", () => Promise.reject(new Error(\"Fail.\")));\n ^\n at [WILDCARD]/failing_steps.ts:[WILDCARD]\n[WILDCARD]","severity":"fail","at":{"file":"./test/steps/failing_steps.ts","line":[WILDCARD]}} - ... - 1..2 -not ok 2 - multiple test step failures - --- - {"message":"2 test steps failed.","severity":"fail","at":{"file":"./test/steps/failing_steps.ts","line":[WILDCARD]}} - ... -# Subtest: failing step in failing test - not ok 1 - step 1 - --- - {"message":"Error: Fail.\n throw new Error(\"Fail.\");\n ^\n at [WILDCARD]/failing_steps.ts:[WILDCARD]\n[WILDCARD]","severity":"fail","at":{"file":"./test/steps/failing_steps.ts","line":[WILDCARD]}} - ... - 1..1 -not ok 3 - failing step in failing test - --- - {"message":"Error: Fail test.\n throw new Error(\"Fail test.\");\n ^\n at [WILDCARD]/failing_steps.ts:[WILDCARD]","severity":"fail","at":{"file":"./test/steps/failing_steps.ts","line":[WILDCARD]}} - ... -1..3 -error: Test failed diff --git a/tests/testdata/test/steps/failing_steps.ts b/tests/testdata/test/steps/failing_steps.ts deleted file mode 100644 index efa18d54e..000000000 --- a/tests/testdata/test/steps/failing_steps.ts +++ /dev/null @@ -1,27 +0,0 @@ -Deno.test("nested failure", async (t) => { - const success = await t.step("step 1", async (t) => { - let success = await t.step("inner 1", () => { - throw new Error("Failed."); - }); - if (success) throw new Error("Expected failure"); - - success = await t.step("inner 2", () => {}); - if (!success) throw new Error("Expected success"); - }); - - if (success) throw new Error("Expected failure"); -}); - -Deno.test("multiple test step failures", async (t) => { - await t.step("step 1", () => { - throw new Error("Fail."); - }); - await t.step("step 2", () => Promise.reject(new Error("Fail."))); -}); - -Deno.test("failing step in failing test", async (t) => { - await t.step("step 1", () => { - throw new Error("Fail."); - }); - throw new Error("Fail test."); -}); diff --git a/tests/testdata/test/steps/ignored_steps.dot.out b/tests/testdata/test/steps/ignored_steps.dot.out deleted file mode 100644 index 442a06c62..000000000 --- a/tests/testdata/test/steps/ignored_steps.dot.out +++ /dev/null @@ -1,5 +0,0 @@ -, -. -. - -ok | 1 passed (1 step) | 0 failed | 0 ignored (1 step) [WILDCARD] diff --git a/tests/testdata/test/steps/ignored_steps.out b/tests/testdata/test/steps/ignored_steps.out deleted file mode 100644 index 2786e1e1a..000000000 --- a/tests/testdata/test/steps/ignored_steps.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD] -running 1 test from ./test/steps/ignored_steps.ts -ignored step ... - step 1 ... ignored ([WILDCARD]) - step 2 ... ok ([WILDCARD]) -ignored step ... ok ([WILDCARD]) - -ok | 1 passed (1 step) | 0 failed | 0 ignored (1 step) [WILDCARD] diff --git a/tests/testdata/test/steps/ignored_steps.tap.out b/tests/testdata/test/steps/ignored_steps.tap.out deleted file mode 100644 index b2b2f5070..000000000 --- a/tests/testdata/test/steps/ignored_steps.tap.out +++ /dev/null @@ -1,8 +0,0 @@ -TAP version 14 -# ./test/steps/ignored_steps.ts -# Subtest: ignored step - ok 1 - step 1 # SKIP - ok 2 - step 2 - 1..2 -ok 1 - ignored step -1..1 diff --git a/tests/testdata/test/steps/ignored_steps.ts b/tests/testdata/test/steps/ignored_steps.ts deleted file mode 100644 index 102b481fb..000000000 --- a/tests/testdata/test/steps/ignored_steps.ts +++ /dev/null @@ -1,16 +0,0 @@ -Deno.test("ignored step", async (t) => { - let result = await t.step({ - name: "step 1", - ignore: true, - fn: () => { - throw new Error("Fail."); - }, - }); - if (result !== false) throw new Error("Expected false."); - result = await t.step({ - name: "step 2", - ignore: false, - fn: () => {}, - }); - if (result !== true) throw new Error("Expected true."); -}); diff --git a/tests/testdata/test/steps/invalid_usage.out b/tests/testdata/test/steps/invalid_usage.out deleted file mode 100644 index 4b82befae..000000000 --- a/tests/testdata/test/steps/invalid_usage.out +++ /dev/null @@ -1,82 +0,0 @@ -[WILDCARD] -running 7 tests from ./test/steps/invalid_usage.ts -capturing ... - some step ... ok ([WILDCARD]) -capturing ... FAILED ([WILDCARD]) -top level missing await ... - step ... INCOMPLETE -top level missing await ... FAILED (due to incomplete steps) ([WILDCARD]) -inner missing await ... - step ... - inner ... INCOMPLETE - step ... FAILED (due to incomplete steps) ([WILDCARD]) -inner missing await ... FAILED (due to 1 failed step) ([WILDCARD]) -parallel steps with sanitizers ... - step 1 ... INCOMPLETE - step 2 ... FAILED ([WILDCARD]) -parallel steps with sanitizers ... FAILED (due to incomplete steps) ([WILDCARD]) -parallel steps when first has sanitizer ... - step 1 ... ok ([WILDCARD]) - step 2 ... FAILED ([WILDCARD]) -parallel steps when first has sanitizer ... FAILED (due to 1 failed step) ([WILDCARD]) -parallel steps when second has sanitizer ... - step 1 ... ok ([WILDCARD]) - step 2 ... FAILED ([WILDCARD]) -parallel steps when second has sanitizer ... FAILED (due to 1 failed step) ([WILDCARD]) -parallel steps where only inner tests have sanitizers ... - step 1 ... - step inner ... ok ([WILDCARD]) - step 1 ... ok ([WILDCARD]) - step 2 ... - step inner ... FAILED ([WILDCARD]) - step 2 ... FAILED (due to 1 failed step) ([WILDCARD]) -parallel steps where only inner tests have sanitizers ... FAILED (due to 1 failed step) ([WILDCARD]) - - ERRORS - -capturing => ./test/steps/invalid_usage.ts:[WILDCARD] -error: Error: Cannot run test step after parent scope has finished execution. Ensure any `.step(...)` calls are executed before their parent scope completes execution. - await capturedContext.step("next step", () => {}); - ^ - at TestContext.step ([WILDCARD]) - at [WILDCARD]/invalid_usage.ts:[WILDCARD] - -top level missing await ... step => ./test/steps/invalid_usage.ts:[WILDCARD] -error: Didn't complete before parent. Await step with `await t.step(...)`. - -inner missing await ... step ... inner => ./test/steps/invalid_usage.ts:[WILDCARD] -error: Didn't complete before parent. Await step with `await t.step(...)`. - -parallel steps with sanitizers ... step 2 => ./test/steps/invalid_usage.ts:[WILDCARD] -error: Started test step while another test step with sanitizers was running: - * parallel steps with sanitizers ... step 1 - -parallel steps with sanitizers ... step 1 => ./test/steps/invalid_usage.ts:[WILDCARD] -error: Didn't complete before parent. Await step with `await t.step(...)`. - -parallel steps when first has sanitizer ... step 2 => ./test/steps/invalid_usage.ts:[WILDCARD] -error: Started test step while another test step with sanitizers was running: - * parallel steps when first has sanitizer ... step 1 - -parallel steps when second has sanitizer ... step 2 => ./test/steps/invalid_usage.ts:[WILDCARD] -error: Started test step with sanitizers while another test step was running: - * parallel steps when second has sanitizer ... step 1 - -parallel steps where only inner tests have sanitizers ... step 2 ... step inner => ./test/steps/invalid_usage.ts:[WILDCARD] -error: Started test step with sanitizers while another test step was running: - * parallel steps where only inner tests have sanitizers ... step 1 - - FAILURES - -capturing => ./test/steps/invalid_usage.ts:1:6 -top level missing await ... step => ./test/steps/invalid_usage.ts:[WILDCARD] -inner missing await ... step ... inner => ./test/steps/invalid_usage.ts:[WILDCARD] -parallel steps with sanitizers ... step 2 => ./test/steps/invalid_usage.ts:[WILDCARD] -parallel steps with sanitizers ... step 1 => ./test/steps/invalid_usage.ts:[WILDCARD] -parallel steps when first has sanitizer ... step 2 => ./test/steps/invalid_usage.ts:[WILDCARD] -parallel steps when second has sanitizer ... step 2 => ./test/steps/invalid_usage.ts:[WILDCARD] -parallel steps where only inner tests have sanitizers ... step 2 ... step inner => ./test/steps/invalid_usage.ts:[WILDCARD] - -FAILED | 0 passed (5 steps) | 7 failed (9 steps) ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/steps/invalid_usage.ts b/tests/testdata/test/steps/invalid_usage.ts deleted file mode 100644 index 1acfc874c..000000000 --- a/tests/testdata/test/steps/invalid_usage.ts +++ /dev/null @@ -1,118 +0,0 @@ -Deno.test("capturing", async (t) => { - let capturedContext!: Deno.TestContext; - await t.step("some step", (t) => { - capturedContext = t; - }); - // this should error because the scope of the tester has already completed - await capturedContext.step("next step", () => {}); -}); - -Deno.test("top level missing await", (t) => { - t.step("step", () => { - return new Promise(() => {}); - }); -}); - -Deno.test({ - name: "inner missing await", - fn: async (t) => { - await t.step("step", (t) => { - t.step("inner", () => { - return new Promise((resolve) => setTimeout(resolve, 10)); - }); - }); - await new Promise((resolve) => setTimeout(resolve, 10)); - }, - sanitizeResources: false, - sanitizeOps: false, - sanitizeExit: false, -}); - -Deno.test("parallel steps with sanitizers", async (t) => { - // not allowed because steps with sanitizers cannot be run in parallel - const step1Entered = Promise.withResolvers<void>(); - const testFinished = Promise.withResolvers<void>(); - t.step("step 1", async () => { - step1Entered.resolve(); - await testFinished.promise; - }); - await step1Entered.promise; - await t.step("step 2", () => {}); -}); - -Deno.test("parallel steps when first has sanitizer", async (t) => { - const step1Entered = Promise.withResolvers<void>(); - const step2Finished = Promise.withResolvers<void>(); - const step1 = t.step({ - name: "step 1", - fn: async () => { - step1Entered.resolve(); - await step2Finished.promise; - }, - }); - await step1Entered.promise; - await t.step({ - name: "step 2", - fn: () => {}, - sanitizeOps: false, - sanitizeResources: false, - sanitizeExit: false, - }); - step2Finished.resolve(); - await step1; -}); - -Deno.test("parallel steps when second has sanitizer", async (t) => { - const step1Entered = Promise.withResolvers<void>(); - const step2Finished = Promise.withResolvers<void>(); - const step1 = t.step({ - name: "step 1", - fn: async () => { - step1Entered.resolve(); - await step2Finished.promise; - }, - sanitizeOps: false, - sanitizeResources: false, - sanitizeExit: false, - }); - await step1Entered.promise; - await t.step({ - name: "step 2", - fn: async () => { - await new Promise((resolve) => setTimeout(resolve, 100)); - }, - }); - step2Finished.resolve(); - await step1; -}); - -Deno.test({ - name: "parallel steps where only inner tests have sanitizers", - fn: async (t) => { - const step1Entered = Promise.withResolvers<void>(); - const step2Finished = Promise.withResolvers<void>(); - const step1 = t.step("step 1", async (t) => { - await t.step({ - name: "step inner", - fn: async () => { - step1Entered.resolve(); - await step2Finished.promise; - }, - sanitizeOps: true, - }); - }); - await step1Entered.promise; - await t.step("step 2", async (t) => { - await t.step({ - name: "step inner", - fn: () => {}, - sanitizeOps: true, - }); - }); - step2Finished.resolve(); - await step1; - }, - sanitizeResources: false, - sanitizeOps: false, - sanitizeExit: false, -}); diff --git a/tests/testdata/test/steps/output_within.out b/tests/testdata/test/steps/output_within.out deleted file mode 100644 index d58722daa..000000000 --- a/tests/testdata/test/steps/output_within.out +++ /dev/null @@ -1,29 +0,0 @@ -[WILDCARD] -running 1 test from ./test/steps/output_within.ts -description ... -------- output ------- -1 ------ output end ----- - step 1 ... -------- output ------- -2 ------ output end ----- - inner 1 ... -------- output ------- -3 ------ output end ----- - inner 1 ... ok ([WILDCARD]s) - inner 2 ... -------- output ------- -4 ------ output end ----- - inner 2 ... ok ([WILDCARD]s) -------- output ------- -5 ------ output end ----- - step 1 ... ok ([WILDCARD]s) -------- output ------- -6 ------ output end ----- -description ... ok ([WILDCARD]s) -[WILDCARD] diff --git a/tests/testdata/test/steps/output_within.ts b/tests/testdata/test/steps/output_within.ts deleted file mode 100644 index d3438a8ad..000000000 --- a/tests/testdata/test/steps/output_within.ts +++ /dev/null @@ -1,15 +0,0 @@ -Deno.test("description", async (t) => { - // the output is not great, but this is an extreme scenario - console.log(1); - await t.step("step 1", async (t) => { - console.log(2); - await t.step("inner 1", () => { - console.log(3); - }); - await t.step("inner 2", () => { - console.log(4); - }); - console.log(5); - }); - console.log(6); -}); diff --git a/tests/testdata/test/steps/passing_steps.dot.out b/tests/testdata/test/steps/passing_steps.dot.out deleted file mode 100644 index 243cacd69..000000000 --- a/tests/testdata/test/steps/passing_steps.dot.out +++ /dev/null @@ -1,17 +0,0 @@ -[WILDCARD] -. -. -. -. -. -. -. -. -. -. -. -. -. - -ok | 6 passed (21 steps) | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/steps/passing_steps.out b/tests/testdata/test/steps/passing_steps.out deleted file mode 100644 index 0757a4ed3..000000000 --- a/tests/testdata/test/steps/passing_steps.out +++ /dev/null @@ -1,44 +0,0 @@ -[WILDCARD] -running 6 tests from ./test/steps/passing_steps.ts -description ... - step 1 ... - inner 1 ... ok ([WILDCARD]s) - inner 2 ... ok ([WILDCARD]s) - step 1 ... ok ([WILDCARD]s) -description ... ok ([WILDCARD]s) -description function as first arg ... - step1 ... - inner1 ... ok ([WILDCARD]s) - inner1 ... ok ([WILDCARD]s) - step1 ... ok ([WILDCARD]s) -description function as first arg ... ok ([WILDCARD]s) -parallel steps without sanitizers ... - step 1 ... ok ([WILDCARD]) - step 2 ... ok ([WILDCARD]) -parallel steps without sanitizers ... ok ([WILDCARD]) -parallel steps without sanitizers due to parent ... - step 1 ... ok ([WILDCARD]) - step 2 ... ok ([WILDCARD]) -parallel steps without sanitizers due to parent ... ok ([WILDCARD]) -steps with disabled sanitizers, then enabled, then parallel disabled ... - step 1 ... - step 1 ... - step 1 ... - step 1 ... ok ([WILDCARD]) - step 1 ... ok ([WILDCARD]) - step 1 ... ok ([WILDCARD]) - step 2 ... ok ([WILDCARD]) - step 1 ... ok ([WILDCARD]) - step 1 ... ok ([WILDCARD]) -steps with disabled sanitizers, then enabled, then parallel disabled ... ok ([WILDCARD]) -steps buffered then streaming reporting ... - step 1 ... - step 1 - 1 ... ok ([WILDCARD]) - step 1 - 2 ... - step 1 - 2 - 1 ... ok ([WILDCARD]) - step 1 - 2 ... ok ([WILDCARD]) - step 1 ... ok ([WILDCARD]) - step 2 ... ok ([WILDCARD]) -steps buffered then streaming reporting ... ok ([WILDCARD]) - -ok | 6 passed (21 steps) | 0 failed [WILDCARD] diff --git a/tests/testdata/test/steps/passing_steps.tap.out b/tests/testdata/test/steps/passing_steps.tap.out deleted file mode 100644 index 20a9fa312..000000000 --- a/tests/testdata/test/steps/passing_steps.tap.out +++ /dev/null @@ -1,42 +0,0 @@ -TAP version 14 -# ./test/steps/passing_steps.ts -# Subtest: description - ok 1 - inner 1 - ok 2 - inner 2 - ok 3 - step 1 - 1..3 -ok 1 - description -# Subtest: description function as first arg - ok 1 - inner1 - ok 2 - inner1 - ok 3 - step1 - 1..3 -ok 2 - description function as first arg -# Subtest: parallel steps without sanitizers - ok 1 - step 1 - ok 2 - step 2 - 1..2 -ok 3 - parallel steps without sanitizers -# Subtest: parallel steps without sanitizers due to parent - ok 1 - step 1 - ok 2 - step 2 - 1..2 -ok 4 - parallel steps without sanitizers due to parent -# Subtest: steps with disabled sanitizers, then enabled, then parallel disabled - ok 1 - step 2 - ok 2 - step 1 - ok 3 - step 1 - ok 4 - step 1 - ok 5 - step 1 - ok 6 - step 1 - 1..6 -ok 5 - steps with disabled sanitizers, then enabled, then parallel disabled -# Subtest: steps buffered then streaming reporting - ok 1 - step 1 - 2 - 1 - ok 2 - step 1 - 2 - ok 3 - step 1 - 1 - ok 4 - step 1 - ok 5 - step 2 - 1..5 -ok 6 - steps buffered then streaming reporting -1..6 diff --git a/tests/testdata/test/steps/passing_steps.ts b/tests/testdata/test/steps/passing_steps.ts deleted file mode 100644 index fd145954b..000000000 --- a/tests/testdata/test/steps/passing_steps.ts +++ /dev/null @@ -1,127 +0,0 @@ -Deno.test("description", async (t) => { - const success = await t.step("step 1", async (t) => { - await t.step("inner 1", () => {}); - await t.step("inner 2", () => {}); - }); - - if (!success) throw new Error("Expected the step to return true."); -}); - -Deno.test("description function as first arg", async (t) => { - const success = await t.step(async function step1(t) { - await t.step(function inner1() {}); - await t.step(function inner1() {}); - }); - - if (!success) throw new Error("Expected the step to return true."); -}); - -Deno.test("parallel steps without sanitizers", async (t) => { - // allowed - await Promise.all([ - t.step({ - name: "step 1", - fn: async () => { - await new Promise((resolve) => setTimeout(resolve, 10)); - }, - sanitizeOps: false, - sanitizeResources: false, - sanitizeExit: false, - }), - t.step({ - name: "step 2", - fn: async () => { - await new Promise((resolve) => setTimeout(resolve, 10)); - }, - sanitizeOps: false, - sanitizeResources: false, - sanitizeExit: false, - }), - ]); -}); - -Deno.test({ - name: "parallel steps without sanitizers due to parent", - fn: async (t) => { - // allowed because parent disabled the sanitizers - await Promise.all([ - t.step("step 1", async () => { - await new Promise((resolve) => setTimeout(resolve, 10)); - }), - t.step("step 2", async () => { - await new Promise((resolve) => setTimeout(resolve, 10)); - }), - ]); - }, - sanitizeResources: false, - sanitizeOps: false, - sanitizeExit: false, -}); - -Deno.test({ - name: "steps with disabled sanitizers, then enabled, then parallel disabled", - fn: async (t) => { - await t.step("step 1", async (t) => { - await t.step({ - name: "step 1", - fn: async (t) => { - await Promise.all([ - t.step({ - name: "step 1", - fn: async (t) => { - await new Promise((resolve) => setTimeout(resolve, 10)); - await Promise.all([ - t.step("step 1", () => {}), - t.step("step 1", () => {}), - ]); - }, - sanitizeExit: false, - sanitizeResources: false, - sanitizeOps: false, - }), - t.step({ - name: "step 2", - fn: () => {}, - sanitizeResources: false, - sanitizeOps: false, - sanitizeExit: false, - }), - ]); - }, - sanitizeResources: true, - sanitizeOps: true, - sanitizeExit: true, - }); - }); - }, - sanitizeResources: false, - sanitizeOps: false, - sanitizeExit: false, -}); - -Deno.test("steps buffered then streaming reporting", async (t) => { - // no sanitizers so this will be buffered - await t.step({ - name: "step 1", - fn: async (t) => { - // also ensure the buffered tests display in order regardless of the second one finishing first - const step2Finished = Promise.withResolvers<void>(); - const step1 = t.step("step 1 - 1", async () => { - await step2Finished.promise; - }); - const step2 = t.step("step 1 - 2", async (t) => { - await t.step("step 1 - 2 - 1", () => {}); - }); - await step2; - step2Finished.resolve(); - await step1; - }, - sanitizeResources: false, - sanitizeOps: false, - sanitizeExit: false, - }); - - // now this will start streaming and we want to - // ensure it flushes the buffer of the last test - await t.step("step 2", async () => {}); -}); diff --git a/tests/testdata/test/text.md b/tests/testdata/test/text.md deleted file mode 100644 index be89d24bf..000000000 --- a/tests/testdata/test/text.md +++ /dev/null @@ -1 +0,0 @@ -This fixture contains no actual tests. diff --git a/tests/testdata/test/text.out b/tests/testdata/test/text.out deleted file mode 100644 index f1b7f7d01..000000000 --- a/tests/testdata/test/text.out +++ /dev/null @@ -1,3 +0,0 @@ - -ok | 0 passed | 0 failed ([WILDCARD]) - diff --git a/tests/testdata/test/uncaught_errors.out b/tests/testdata/test/uncaught_errors.out deleted file mode 100644 index a52f95d57..000000000 --- a/tests/testdata/test/uncaught_errors.out +++ /dev/null @@ -1,59 +0,0 @@ -running 3 tests from ./test/uncaught_errors_1.ts -foo 1 ... FAILED ([WILDCARD]) -foo 2 ... ok ([WILDCARD]) -foo 3 ... -Uncaught error from ./test/uncaught_errors_1.ts FAILED -foo 3 ... cancelled (0ms) -running 3 tests from ./test/uncaught_errors_2.ts -bar 1 ... ok ([WILDCARD]) -bar 2 ... FAILED ([WILDCARD]) -bar 3 ... FAILED ([WILDCARD]) -Uncaught error from ./test/uncaught_errors_3.ts FAILED - - ERRORS - -foo 1 => ./test/uncaught_errors_1.ts:1:6 -error: Error: foo 1 message - throw new Error("foo 1 message"); - ^ - at [WILDCARD]/test/uncaught_errors_1.ts:2:9 - -./test/uncaught_errors_1.ts (uncaught error) -error: (in promise) Error: foo 3 message - Promise.reject(new Error("foo 3 message")); - ^ - at [WILDCARD]/test/uncaught_errors_1.ts:8:18 -This error was not caught from a test and caused the test runner to fail on the referenced module. -It most likely originated from a dangling promise, event/timeout handler or top-level code. - -bar 2 => ./test/uncaught_errors_2.ts:3:6 -error: Error: bar 2 - throw new Error("bar 2"); - ^ - at [WILDCARD]/test/uncaught_errors_2.ts:4:9 - -bar 3 => ./test/uncaught_errors_2.ts:6:6 -error: Error: bar 3 message - throw new Error("bar 3 message"); - ^ - at [WILDCARD]/test/uncaught_errors_2.ts:7:9 - -./test/uncaught_errors_3.ts (uncaught error) -error: (in promise) Error: baz -throw new Error("baz"); - ^ - at [WILDCARD]/test/uncaught_errors_3.ts:1:7 -This error was not caught from a test and caused the test runner to fail on the referenced module. -It most likely originated from a dangling promise, event/timeout handler or top-level code. - - FAILURES - -foo 1 => ./test/uncaught_errors_1.ts:1:6 -./test/uncaught_errors_1.ts (uncaught error) -bar 2 => ./test/uncaught_errors_2.ts:3:6 -bar 3 => ./test/uncaught_errors_2.ts:6:6 -./test/uncaught_errors_3.ts (uncaught error) - -FAILED | 2 passed | 6 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/uncaught_errors_1.ts b/tests/testdata/test/uncaught_errors_1.ts deleted file mode 100644 index 166b23ac3..000000000 --- a/tests/testdata/test/uncaught_errors_1.ts +++ /dev/null @@ -1,9 +0,0 @@ -Deno.test("foo 1", () => { - throw new Error("foo 1 message"); -}); - -Deno.test("foo 2", () => {}); - -Deno.test("foo 3", () => { - Promise.reject(new Error("foo 3 message")); -}); diff --git a/tests/testdata/test/uncaught_errors_2.ts b/tests/testdata/test/uncaught_errors_2.ts deleted file mode 100644 index 8cafbe291..000000000 --- a/tests/testdata/test/uncaught_errors_2.ts +++ /dev/null @@ -1,8 +0,0 @@ -Deno.test("bar 1", () => {}); - -Deno.test("bar 2", () => { - throw new Error("bar 2"); -}); -Deno.test("bar 3", () => { - throw new Error("bar 3 message"); -}); diff --git a/tests/testdata/test/uncaught_errors_3.ts b/tests/testdata/test/uncaught_errors_3.ts deleted file mode 100644 index cb2a55036..000000000 --- a/tests/testdata/test/uncaught_errors_3.ts +++ /dev/null @@ -1 +0,0 @@ -throw new Error("baz"); diff --git a/tests/testdata/test/unhandled_rejection.out b/tests/testdata/test/unhandled_rejection.out deleted file mode 100644 index bc8387929..000000000 --- a/tests/testdata/test/unhandled_rejection.out +++ /dev/null @@ -1,22 +0,0 @@ -Check [WILDCARD]/test/unhandled_rejection.ts -Uncaught error from ./test/unhandled_rejection.ts FAILED - - ERRORS - -./test/unhandled_rejection.ts (uncaught error) -error: (in promise) Error: rejection - reject(new Error("rejection")); - ^ - at [WILDCARD]/test/unhandled_rejection.ts:2:10 - at new Promise (<anonymous>) - at [WILDCARD]/test/unhandled_rejection.ts:1:1 -This error was not caught from a test and caused the test runner to fail on the referenced module. -It most likely originated from a dangling promise, event/timeout handler or top-level code. - - FAILURES - -./test/unhandled_rejection.ts (uncaught error) - -FAILED | 0 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/tests/testdata/test/unhandled_rejection.ts b/tests/testdata/test/unhandled_rejection.ts deleted file mode 100644 index 32f3111ea..000000000 --- a/tests/testdata/test/unhandled_rejection.ts +++ /dev/null @@ -1,3 +0,0 @@ -new Promise((_resolve, reject) => { - reject(new Error("rejection")); -}); diff --git a/tests/testdata/test/unresolved_promise.out b/tests/testdata/test/unresolved_promise.out deleted file mode 100644 index 88535e171..000000000 --- a/tests/testdata/test/unresolved_promise.out +++ /dev/null @@ -1,10 +0,0 @@ -[WILDCARD] -./test/unresolved_promise.ts (uncaught error) -error: Top-level await promise never resolved -await new Promise((_resolve, _reject) => {}); -^ - at <anonymous> ([WILDCARD]/test/unresolved_promise.ts:1:1) -This error was not caught from a test and caused the test runner to fail on the referenced module. -It most likely originated from a dangling promise, event/timeout handler or top-level code. -[WILDCARD] -error: Test failed diff --git a/tests/testdata/test/unresolved_promise.ts b/tests/testdata/test/unresolved_promise.ts deleted file mode 100644 index 25fe70762..000000000 --- a/tests/testdata/test/unresolved_promise.ts +++ /dev/null @@ -1 +0,0 @@ -await new Promise((_resolve, _reject) => {}); |