diff options
Diffstat (limited to 'cli/tests')
39 files changed, 0 insertions, 450 deletions
diff --git a/cli/tests/integration/compat_tests.rs b/cli/tests/integration/compat_tests.rs deleted file mode 100644 index 88514832f..000000000 --- a/cli/tests/integration/compat_tests.rs +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. - -use crate::itest; -use deno_core::url::Url; -use test_util as util; - -/// Tests in this file should use `std_file_url` to override `DENO_NODE_COMPAT_URL` -/// env variable. This speeds up tests significantly as they no longer -/// download contents of `deno_std` from `https://deno.land` in each test. - -/// Return a file URL pointing to "std" submodule -/// in "test_util" directory. It must have a trailing slash. -fn std_file_url() -> String { - let u = Url::from_directory_path(util::std_path()).unwrap(); - u.to_string() -} - -itest!(globals { - args: "run --compat --no-check --unstable --allow-read --allow-env compat/globals.ts", - output: "compat/globals.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(fs_promises { - args: "run --compat --no-check --unstable -A compat/fs_promises.mjs", - output: "compat/fs_promises.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -// https://github.com/denoland/deno/issues/12494 -itest_flaky!(node_prefix_fs_promises { - args: "run --compat --no-check --unstable -A compat/node_fs_promises.mjs", - output: "compat/fs_promises.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(compat_with_import_map_and_https_imports { - args: "run --quiet --no-check --compat --unstable -A --import-map=compat/import_map.json compat/import_map_https_imports.mjs", - output: "compat/import_map_https_imports.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(compat_dyn_import_rejects_with_node_compatible_error { - args: - "run --quiet --no-check --compat --unstable -A compat/dyn_import_reject.js", - output: "compat/dyn_import_reject.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(import_esm_from_cjs { - args: - "run --compat --unstable -A --quiet compat/import_esm_from_cjs/index.js", - output_str: Some("function\n"), - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(test_runner_cjs { - args: "test --compat --unstable -A --quiet compat/test_runner/cjs.js", - exit_code: 1, - output: "compat/test_runner/cjs.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(test_runner_esm { - args: "test --compat --unstable -A --quiet compat/test_runner/esm.mjs", - exit_code: 1, - output: "compat/test_runner/esm.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -// Top level assertion test mostly just make sure that the test runner finishes correctly on compat mode -// when there is no tests -itest!(top_level_assertion_cjs { - args: "test --compat --unstable -A --quiet compat/test_runner/top_level_assertion_cjs.js", - exit_code: 0, - output: "compat/test_runner/top_level_assertion_cjs.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(top_level_assertion_esm { - args: "test --compat --unstable -A --quiet compat/test_runner/top_level_assertion_esm.mjs", - exit_code: 0, - output: "compat/test_runner/top_level_assertion_esm.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(top_level_fail_cjs { - args: "test --compat --unstable -A --quiet compat/test_runner/top_level_fail_cjs.js", - exit_code: 1, - output: "compat/test_runner/top_level_fail_cjs.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(top_level_fail_esm { - args: "test --compat --unstable -A --quiet compat/test_runner/top_level_fail_esm.mjs", - exit_code: 1, - output: "compat/test_runner/top_level_fail_esm.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(compat_worker { - args: "run --compat --unstable -A --quiet --no-check compat/worker/worker_test.mjs", - output: "compat/worker/worker_test.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(cjs_esm_interop { - args: - "run --compat --unstable -A --quiet --no-check compat/import_cjs_from_esm/main.mjs", - output: "compat/import_cjs_from_esm.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -itest!(cjs_esm_interop_dynamic { - args: - "run --compat --unstable -A --quiet --no-check compat/import_cjs_from_esm/main_dynamic.mjs", - output: "compat/import_cjs_from_esm.out", - envs: vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())], -}); - -#[test] -fn globals_in_repl() { - let (out, _err) = util::run_and_collect_output_with_args( - true, - vec!["repl", "--compat", "--unstable", "--no-check", "--quiet"], - Some(vec!["global.window == window"]), - Some(vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())]), - false, - ); - assert!(out.contains("true")); -} - -#[test] -fn require_in_repl() { - let (out, _err) = util::run_and_collect_output_with_args( - true, - vec!["repl", "--compat", "--unstable", "--quiet"], - Some(vec![ - "const foo = require('./compat/import_esm_from_cjs/index');", - ]), - Some(vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())]), - false, - ); - assert!(out.contains("function")); -} - -#[test] -fn node_compat_url() { - let (out, err) = util::run_and_collect_output_with_args( - false, - vec!["repl", "--compat", "--unstable", "--no-check", "--quiet"], - None, - Some(vec![( - "DENO_NODE_COMPAT_URL".to_string(), - "file:///non_existent/".to_string(), - )]), - false, - ); - assert!(out.is_empty()); - assert!(!err.is_empty()); - assert!(err.contains("file:///non_existent/node/global.ts")); -} - -#[test] -fn native_modules_as_global_vars() { - let (out, _err) = util::run_and_collect_output_with_args( - true, - vec!["repl", "--compat", "--unstable", "--quiet"], - Some(vec!["if(cluster && v8 && sys) { true } else { false }"]), - Some(vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())]), - false, - ); - assert!(out.contains("true")); -} - -#[ignore] // todo(dsherret): re-enable -#[test] -fn ext_node_cjs_execution() { - let (out, _err) = util::run_and_collect_output_with_args( - true, - vec![ - "run", - "-A", - "--unstable", - "--quiet", - "commonjs/init.js", - "./example.js", - ], - None, - Some(vec![("DENO_NODE_COMPAT_URL".to_string(), std_file_url())]), - false, - ); - assert!(out.contains("{ hello: \"world\" }")); -} diff --git a/cli/tests/integration/mod.rs b/cli/tests/integration/mod.rs index 742c0e3a7..84ec34f2b 100644 --- a/cli/tests/integration/mod.rs +++ b/cli/tests/integration/mod.rs @@ -60,8 +60,6 @@ mod bundle; mod cache; #[path = "check_tests.rs"] mod check; -#[path = "compat_tests.rs"] -mod compat; #[path = "compile_tests.rs"] mod compile; #[path = "coverage_tests.rs"] diff --git a/cli/tests/testdata/compat/dyn_import_reject.js b/cli/tests/testdata/compat/dyn_import_reject.js deleted file mode 100644 index f9a99f0da..000000000 --- a/cli/tests/testdata/compat/dyn_import_reject.js +++ /dev/null @@ -1,4 +0,0 @@ -import("./foobar.js").catch((e) => { - console.log(e); - console.log(e.code); -}); diff --git a/cli/tests/testdata/compat/dyn_import_reject.out b/cli/tests/testdata/compat/dyn_import_reject.out deleted file mode 100644 index 1324c8aeb..000000000 --- a/cli/tests/testdata/compat/dyn_import_reject.out +++ /dev/null @@ -1,2 +0,0 @@ -TypeError: [ERR_MODULE_NOT_FOUND] Cannot find module "file://[WILDCARD]/testdata/compat/foobar.js" imported from "file://[WILDCARD]/testdata/compat/dyn_import_reject.js" -ERR_MODULE_NOT_FOUND diff --git a/cli/tests/testdata/compat/fs_promises.mjs b/cli/tests/testdata/compat/fs_promises.mjs deleted file mode 100644 index 3f7b4c935..000000000 --- a/cli/tests/testdata/compat/fs_promises.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import fs from "fs/promises"; -const data = await fs.readFile("compat/test.txt", "utf-8"); -console.log(data); diff --git a/cli/tests/testdata/compat/fs_promises.out b/cli/tests/testdata/compat/fs_promises.out deleted file mode 100644 index 368d06776..000000000 --- a/cli/tests/testdata/compat/fs_promises.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -This is some example text that will be read using compatiblity mode. diff --git a/cli/tests/testdata/compat/globals.out b/cli/tests/testdata/compat/globals.out deleted file mode 100644 index 32230fda3..000000000 --- a/cli/tests/testdata/compat/globals.out +++ /dev/null @@ -1,9 +0,0 @@ -[WILDCARD] -process { -[WILDCARD] -} -[Function: Buffer] { -[WILDCARD] -} -[Function: setImmediate] -[Function: clearTimeout] diff --git a/cli/tests/testdata/compat/globals.ts b/cli/tests/testdata/compat/globals.ts deleted file mode 100644 index bd80fb3d7..000000000 --- a/cli/tests/testdata/compat/globals.ts +++ /dev/null @@ -1,4 +0,0 @@ -console.log(process); -console.log(Buffer); -console.log(setImmediate); -console.log(clearImmediate); diff --git a/cli/tests/testdata/compat/import_cjs_from_esm.out b/cli/tests/testdata/compat/import_cjs_from_esm.out deleted file mode 100644 index ffaa5e406..000000000 --- a/cli/tests/testdata/compat/import_cjs_from_esm.out +++ /dev/null @@ -1 +0,0 @@ -{ a: "A", b: "B", foo: "foo", bar: "bar", fizz: { buzz: "buzz", fizz: "FIZZ" } } diff --git a/cli/tests/testdata/compat/import_cjs_from_esm/imported.js b/cli/tests/testdata/compat/import_cjs_from_esm/imported.js deleted file mode 100644 index 49ab4c782..000000000 --- a/cli/tests/testdata/compat/import_cjs_from_esm/imported.js +++ /dev/null @@ -1,9 +0,0 @@ -exports = { - a: "A", - b: "B", -}; -exports.foo = "foo"; -exports.bar = "bar"; -exports.fizz = require("./reexports.js"); - -console.log(exports); diff --git a/cli/tests/testdata/compat/import_cjs_from_esm/main.mjs b/cli/tests/testdata/compat/import_cjs_from_esm/main.mjs deleted file mode 100644 index 6fbed1b7c..000000000 --- a/cli/tests/testdata/compat/import_cjs_from_esm/main.mjs +++ /dev/null @@ -1 +0,0 @@ -import "./imported.js"; diff --git a/cli/tests/testdata/compat/import_cjs_from_esm/main_dynamic.mjs b/cli/tests/testdata/compat/import_cjs_from_esm/main_dynamic.mjs deleted file mode 100644 index b94033268..000000000 --- a/cli/tests/testdata/compat/import_cjs_from_esm/main_dynamic.mjs +++ /dev/null @@ -1,2 +0,0 @@ -const url = import.meta.resolve("./imported.js"); -await import(url); diff --git a/cli/tests/testdata/compat/import_cjs_from_esm/reexports.js b/cli/tests/testdata/compat/import_cjs_from_esm/reexports.js deleted file mode 100644 index 62edb7708..000000000 --- a/cli/tests/testdata/compat/import_cjs_from_esm/reexports.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./reexports2.js"); diff --git a/cli/tests/testdata/compat/import_cjs_from_esm/reexports2.js b/cli/tests/testdata/compat/import_cjs_from_esm/reexports2.js deleted file mode 100644 index 183d833b0..000000000 --- a/cli/tests/testdata/compat/import_cjs_from_esm/reexports2.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.buzz = "buzz"; -exports.fizz = "FIZZ"; diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/index.js b/cli/tests/testdata/compat/import_esm_from_cjs/index.js deleted file mode 100644 index 4ba03e104..000000000 --- a/cli/tests/testdata/compat/import_esm_from_cjs/index.js +++ /dev/null @@ -1 +0,0 @@ -require("pure-cjs"); diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/index.js b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/index.js deleted file mode 100644 index 35f7c3774..000000000 --- a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/index.js +++ /dev/null @@ -1,4 +0,0 @@ -async function run() { - const _result = await import('pure-esm'); -} -run() diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/package.json b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/package.json deleted file mode 100644 index e854fd992..000000000 --- a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-cjs/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "pure-cjs", - "main": "./index.js" -} diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/index.js b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/index.js deleted file mode 100644 index 898097cb5..000000000 --- a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import fs from 'node:fs'; -console.log(typeof fs.chmod); diff --git a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/package.json b/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/package.json deleted file mode 100644 index a373d3ad9..000000000 --- a/cli/tests/testdata/compat/import_esm_from_cjs/node_modules/pure-esm/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "pure-esm", - "type": "module", - "main": "./index.js" -} diff --git a/cli/tests/testdata/compat/import_map.json b/cli/tests/testdata/compat/import_map.json deleted file mode 100644 index 8488f0140..000000000 --- a/cli/tests/testdata/compat/import_map.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "std/": "https://deno.land/std@0.126.0/" - } -} diff --git a/cli/tests/testdata/compat/import_map_https_imports.mjs b/cli/tests/testdata/compat/import_map_https_imports.mjs deleted file mode 100644 index d8c2a89c2..000000000 --- a/cli/tests/testdata/compat/import_map_https_imports.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import { sortBy } from "std/collections/sort_by.ts"; -import { findSingle } from "https://deno.land/std@0.126.0/collections/find_single.ts"; -import os from "node:os"; - -console.log(sortBy([2, 3, 1], (it) => it)); -console.log(findSingle([2, 3, 1], (it) => it == 2)); -console.log("arch", os.arch()); diff --git a/cli/tests/testdata/compat/import_map_https_imports.out b/cli/tests/testdata/compat/import_map_https_imports.out deleted file mode 100644 index 7ee30676e..000000000 --- a/cli/tests/testdata/compat/import_map_https_imports.out +++ /dev/null @@ -1,3 +0,0 @@ -[ 1, 2, 3 ] -2 -arch [WILDCARD] diff --git a/cli/tests/testdata/compat/node_fs_promises.mjs b/cli/tests/testdata/compat/node_fs_promises.mjs deleted file mode 100644 index b2174b22b..000000000 --- a/cli/tests/testdata/compat/node_fs_promises.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import fs from "node:fs/promises"; -const data = await fs.readFile("compat/test.txt", "utf-8"); -console.log(data); diff --git a/cli/tests/testdata/compat/test.txt b/cli/tests/testdata/compat/test.txt deleted file mode 100644 index 422e7b0c0..000000000 --- a/cli/tests/testdata/compat/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is some example text that will be read using compatiblity mode.
\ No newline at end of file diff --git a/cli/tests/testdata/compat/test_runner/cjs.js b/cli/tests/testdata/compat/test_runner/cjs.js deleted file mode 100644 index 96a1b5112..000000000 --- a/cli/tests/testdata/compat/test_runner/cjs.js +++ /dev/null @@ -1,9 +0,0 @@ -const { strictEqual } = require("assert"); - -Deno.test("Correct assertion", () => { - strictEqual(20, 20); -}); - -Deno.test("Failed assertion", () => { - strictEqual(10, 20); -}); diff --git a/cli/tests/testdata/compat/test_runner/cjs.out b/cli/tests/testdata/compat/test_runner/cjs.out deleted file mode 100644 index 2e1e29e61..000000000 --- a/cli/tests/testdata/compat/test_runner/cjs.out +++ /dev/null @@ -1,27 +0,0 @@ -running 2 tests from ./compat/test_runner/cjs.js -Correct assertion ... ok ([WILDCARD]) -Failed assertion ... FAILED ([WILDCARD]) - - ERRORS - -Failed assertion => ./compat/test_runner/cjs.js:[WILDCARD] -error: AssertionError: Values are not strictly equal: - - - [Diff] Actual / Expected - - -- 10 -+ 20 - - Error.captureStackTrace(this, stackStartFn || stackStartFunction); - ^ -[WILDCARD] - - FAILURES - -Failed assertion => ./compat/test_runner/cjs.js:[WILDCARD] - -FAILED | 1 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/cli/tests/testdata/compat/test_runner/esm.mjs b/cli/tests/testdata/compat/test_runner/esm.mjs deleted file mode 100644 index 54a9468a4..000000000 --- a/cli/tests/testdata/compat/test_runner/esm.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { strictEqual } from "assert"; - -Deno.test("Correct assertion", () => { - strictEqual(20, 20); -}); - -Deno.test("Failed assertion", () => { - strictEqual(10, 20); -}); diff --git a/cli/tests/testdata/compat/test_runner/esm.out b/cli/tests/testdata/compat/test_runner/esm.out deleted file mode 100644 index e69573da1..000000000 --- a/cli/tests/testdata/compat/test_runner/esm.out +++ /dev/null @@ -1,27 +0,0 @@ -running 2 tests from ./compat/test_runner/esm.mjs -Correct assertion ... ok ([WILDCARD]) -Failed assertion ... FAILED ([WILDCARD]) - - ERRORS - -Failed assertion => ./compat/test_runner/esm.mjs:[WILDCARD] -error: AssertionError: Values are not strictly equal: - - - [Diff] Actual / Expected - - -- 10 -+ 20 - - Error.captureStackTrace(this, stackStartFn || stackStartFunction); - ^ -[WILDCARD] - - FAILURES - -Failed assertion => ./compat/test_runner/esm.mjs:[WILDCARD] - -FAILED | 1 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.js b/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.js deleted file mode 100644 index 318e72d86..000000000 --- a/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.js +++ /dev/null @@ -1,4 +0,0 @@ -const { notStrictEqual, strictEqual } = require("assert"); - -notStrictEqual(require.main, module, "The module was loaded as a main module"); -strictEqual(20, 20); diff --git a/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.out b/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.out deleted file mode 100644 index f74853cfd..000000000 --- a/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.out +++ /dev/null @@ -1,4 +0,0 @@ -running 0 tests from [WILDCARD] - -ok | 0 passed | 0 failed ([WILDCARD]) - diff --git a/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.mjs b/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.mjs deleted file mode 100644 index 8c217fd55..000000000 --- a/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import assert, { strictEqual } from "assert"; - -assert(!import.meta.main, "The module was loaded as a main module"); -strictEqual(20, 20); diff --git a/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.out b/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.out deleted file mode 100644 index f74853cfd..000000000 --- a/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.out +++ /dev/null @@ -1,4 +0,0 @@ -running 0 tests from [WILDCARD] - -ok | 0 passed | 0 failed ([WILDCARD]) - diff --git a/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.js b/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.js deleted file mode 100644 index 20f809794..000000000 --- a/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.js +++ /dev/null @@ -1,4 +0,0 @@ -const { notStrictEqual, strictEqual } = require("assert"); - -notStrictEqual(require.main, module, "The module was loaded as a main module"); -strictEqual(10, 20); diff --git a/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out b/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out deleted file mode 100644 index e1777d98a..000000000 --- a/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out +++ /dev/null @@ -1,27 +0,0 @@ -Uncaught error from ./compat/test_runner/top_level_fail_cjs.js FAILED - - ERRORS - -./compat/test_runner/top_level_fail_cjs.js (uncaught error) -error: (in promise) AssertionError: Values are not strictly equal: - - - [Diff] Actual / Expected - - -- 10 -+ 20 - - Error.captureStackTrace(this, stackStartFn || stackStartFunction); - ^ - 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 - -./compat/test_runner/top_level_fail_cjs.js (uncaught error) - -FAILED | 0 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/cli/tests/testdata/compat/test_runner/top_level_fail_esm.mjs b/cli/tests/testdata/compat/test_runner/top_level_fail_esm.mjs deleted file mode 100644 index 918d8c6a8..000000000 --- a/cli/tests/testdata/compat/test_runner/top_level_fail_esm.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import assert, { strictEqual } from "assert"; - -assert(!import.meta.main, "The module was loaded as a main module"); -strictEqual(10, 20); diff --git a/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out b/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out deleted file mode 100644 index d34de2c21..000000000 --- a/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out +++ /dev/null @@ -1,27 +0,0 @@ -Uncaught error from ./compat/test_runner/top_level_fail_esm.mjs FAILED - - ERRORS - -./compat/test_runner/top_level_fail_esm.mjs (uncaught error) -error: AssertionError: Values are not strictly equal: - - - [Diff] Actual / Expected - - -- 10 -+ 20 - - Error.captureStackTrace(this, stackStartFn || stackStartFunction); - ^ - 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 - -./compat/test_runner/top_level_fail_esm.mjs (uncaught error) - -FAILED | 0 passed | 1 failed ([WILDCARD]) - -error: Test failed diff --git a/cli/tests/testdata/compat/worker/worker.mjs b/cli/tests/testdata/compat/worker/worker.mjs deleted file mode 100644 index eb7cfed19..000000000 --- a/cli/tests/testdata/compat/worker/worker.mjs +++ /dev/null @@ -1,9 +0,0 @@ -console.log("hello from worker"); - -self.onmessage = (e) => { - if (e.data != "hello") { - throw new Error("wrong message"); - } - - self.postMessage({ pid: process.pid }); -} diff --git a/cli/tests/testdata/compat/worker/worker_test.mjs b/cli/tests/testdata/compat/worker/worker_test.mjs deleted file mode 100644 index 8613dde0c..000000000 --- a/cli/tests/testdata/compat/worker/worker_test.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { deferred } from "../../../../../test_util/std/async/deferred.ts"; - -const promise = deferred(); -const url = import.meta.resolve("./worker.mjs"); -const worker = new Worker(url, { type: "module" }); - -worker.onmessage = (e) => { - const pid = e.data.pid; - if (typeof pid != "number") { - throw new Error("pid is not a number"); - } - console.log("process.pid from worker:", pid); - promise.resolve(); -}; - -worker.postMessage("hello"); -await promise; -worker.terminate(); diff --git a/cli/tests/testdata/compat/worker/worker_test.out b/cli/tests/testdata/compat/worker/worker_test.out deleted file mode 100644 index 373841945..000000000 --- a/cli/tests/testdata/compat/worker/worker_test.out +++ /dev/null @@ -1,2 +0,0 @@ -hello from worker -process.pid from worker: [WILDCARD] |