diff options
Diffstat (limited to 'cli/tests/testdata')
37 files changed, 0 insertions, 254 deletions
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] |