diff options
author | Mohammad Sulaiman <mohammad.sulaiman@exalt.ps> | 2024-09-25 21:46:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-25 18:46:18 +0000 |
commit | c232ecc6af5a09a8f0480e3b2b87ef2cd2b3a348 (patch) | |
tree | 49874a35cc2d27d90d0ec26423e8bfe040385683 /tests/testdata | |
parent | 8cdb309ffd6686b2f3c4a2126d927fd5770be34d (diff) |
chore: deprecate npm itests (#25804)
Diffstat (limited to 'tests/testdata')
117 files changed, 0 insertions, 1015 deletions
diff --git a/tests/testdata/npm/builtin_module_module/main.js b/tests/testdata/npm/builtin_module_module/main.js deleted file mode 100644 index 9a036791b..000000000 --- a/tests/testdata/npm/builtin_module_module/main.js +++ /dev/null @@ -1 +0,0 @@ -import "npm:@denotest/builtin-module-module"; diff --git a/tests/testdata/npm/builtin_module_module/main.out b/tests/testdata/npm/builtin_module_module/main.out deleted file mode 100644 index 160ba6503..000000000 --- a/tests/testdata/npm/builtin_module_module/main.out +++ /dev/null @@ -1,4 +0,0 @@ -function -function -function -true diff --git a/tests/testdata/npm/check_errors/main.ts b/tests/testdata/npm/check_errors/main.ts deleted file mode 100644 index 4b8684195..000000000 --- a/tests/testdata/npm/check_errors/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as test from "npm:@denotest/check-error"; - -console.log(test.Asdf); // should error diff --git a/tests/testdata/npm/check_errors/main_all.out b/tests/testdata/npm/check_errors/main_all.out deleted file mode 100644 index 4c624c0ea..000000000 --- a/tests/testdata/npm/check_errors/main_all.out +++ /dev/null @@ -1,19 +0,0 @@ -Download http://localhost:4260/@denotest/check-error -Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts -error: TS2506 [ERROR]: 'Class1' is referenced directly or indirectly in its own base expression. -export class Class1 extends Class2 { - ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:2:14 - -TS2506 [ERROR]: 'Class2' is referenced directly or indirectly in its own base expression. -export class Class2 extends Class1 { - ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:5:14 - -TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. -console.log(test.Asdf); // should error - ~~~~ - at file:///[WILDCARD]/check_errors/main.ts:3:18 - -Found 3 errors. diff --git a/tests/testdata/npm/check_errors/main_local.out b/tests/testdata/npm/check_errors/main_local.out deleted file mode 100644 index 4d3a892e7..000000000 --- a/tests/testdata/npm/check_errors/main_local.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/check-error -Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts -error: TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. -console.log(test.Asdf); // should error - ~~~~ - at file:///[WILDCARD]/npm/check_errors/main.ts:3:18 diff --git a/tests/testdata/npm/child_process_fork_test/main.out b/tests/testdata/npm/child_process_fork_test/main.out deleted file mode 100644 index d5bc57741..000000000 --- a/tests/testdata/npm/child_process_fork_test/main.out +++ /dev/null @@ -1,2 +0,0 @@ -function -Done. diff --git a/tests/testdata/npm/child_process_fork_test/main.ts b/tests/testdata/npm/child_process_fork_test/main.ts deleted file mode 100644 index e560edb7e..000000000 --- a/tests/testdata/npm/child_process_fork_test/main.ts +++ /dev/null @@ -1,4 +0,0 @@ -import "npm:chalk@4"; -import { run } from "npm:@denotest/child-process-fork"; - -run(); diff --git a/tests/testdata/npm/cjs-invalid-name-exports/main.out b/tests/testdata/npm/cjs-invalid-name-exports/main.out deleted file mode 100644 index 45ec15d0e..000000000 --- a/tests/testdata/npm/cjs-invalid-name-exports/main.out +++ /dev/null @@ -1,13 +0,0 @@ -[Module: null prototype] { - "a \\ b": "a \\ b", - "another 'case'": "example", - default: { - 'wow "double quotes"': "double quotes", - "another 'case'": "example", - "a \\ b": "a \\ b", - "name variable": "a", - "foo - bar": "foo - bar" - }, - "foo - bar": "foo - bar", - 'wow "double quotes"': "double quotes" -} diff --git a/tests/testdata/npm/cjs-invalid-name-exports/main.ts b/tests/testdata/npm/cjs-invalid-name-exports/main.ts deleted file mode 100644 index 9bdf0e43b..000000000 --- a/tests/testdata/npm/cjs-invalid-name-exports/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as foo from "npm:@denotest/cjs-invalid-name-exports"; - -console.log(foo); diff --git a/tests/testdata/npm/cjs_local_global_decls/main.out b/tests/testdata/npm/cjs_local_global_decls/main.out deleted file mode 100644 index 5e7a36c8d..000000000 --- a/tests/testdata/npm/cjs_local_global_decls/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/cjs-local-global-decls -Download http://localhost:4260/@denotest/cjs-local-global-decls/1.0.0.tgz -Loaded. diff --git a/tests/testdata/npm/cjs_local_global_decls/main.ts b/tests/testdata/npm/cjs_local_global_decls/main.ts deleted file mode 100644 index 04074057b..000000000 --- a/tests/testdata/npm/cjs_local_global_decls/main.ts +++ /dev/null @@ -1 +0,0 @@ -import "npm:@denotest/cjs-local-global-decls@1.0.0"; diff --git a/tests/testdata/npm/cjs_module_export_assignment/main.out b/tests/testdata/npm/cjs_module_export_assignment/main.out deleted file mode 100644 index dea185e38..000000000 --- a/tests/testdata/npm/cjs_module_export_assignment/main.out +++ /dev/null @@ -1,6 +0,0 @@ -{ func: [Function: func] } -[Module: null prototype] { - default: { func: [Function: func] }, - func: [Function: func] -} -5 diff --git a/tests/testdata/npm/cjs_module_export_assignment/main.ts b/tests/testdata/npm/cjs_module_export_assignment/main.ts deleted file mode 100644 index 93d3db1c3..000000000 --- a/tests/testdata/npm/cjs_module_export_assignment/main.ts +++ /dev/null @@ -1,6 +0,0 @@ -import defaultImport, * as namespaceImport from "npm:@denotest/cjs-module-export-assignment"; -import { func } from "npm:@denotest/cjs-module-export-assignment"; - -console.log(defaultImport); -console.log(namespaceImport); -console.log(func()); diff --git a/tests/testdata/npm/cjs_module_export_assignment_number/main.out b/tests/testdata/npm/cjs_module_export_assignment_number/main.out deleted file mode 100644 index e559775cf..000000000 --- a/tests/testdata/npm/cjs_module_export_assignment_number/main.out +++ /dev/null @@ -1,3 +0,0 @@ -5 -5 -[Module: null prototype] { default: 5 } diff --git a/tests/testdata/npm/cjs_module_export_assignment_number/main.ts b/tests/testdata/npm/cjs_module_export_assignment_number/main.ts deleted file mode 100644 index aee24bf19..000000000 --- a/tests/testdata/npm/cjs_module_export_assignment_number/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import defaultImport, * as namespaceImport from "npm:@denotest/cjs-module-export-assignment-number"; - -const testDefault: 5 = defaultImport; -console.log(testDefault); -const testNamespace: 5 = namespaceImport.default; -console.log(testNamespace); -console.log(namespaceImport); diff --git a/tests/testdata/npm/cjs_pkg_imports/main.out b/tests/testdata/npm/cjs_pkg_imports/main.out deleted file mode 100644 index 661146bd0..000000000 --- a/tests/testdata/npm/cjs_pkg_imports/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/cjs-pkg-imports -Download http://localhost:4260/@denotest/cjs-pkg-imports/1.0.0.tgz -{ crypto: Crypto { subtle: SubtleCrypto {} }, number: 5 } diff --git a/tests/testdata/npm/cjs_pkg_imports/main.ts b/tests/testdata/npm/cjs_pkg_imports/main.ts deleted file mode 100644 index b30a3f85c..000000000 --- a/tests/testdata/npm/cjs_pkg_imports/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import crypto from "npm:@denotest/cjs-pkg-imports"; - -console.log(crypto); diff --git a/tests/testdata/npm/cjs_reexport_collision/main.out b/tests/testdata/npm/cjs_reexport_collision/main.out deleted file mode 100644 index ed3193f8d..000000000 --- a/tests/testdata/npm/cjs_reexport_collision/main.out +++ /dev/null @@ -1 +0,0 @@ -Hi. diff --git a/tests/testdata/npm/cjs_reexport_collision/main.ts b/tests/testdata/npm/cjs_reexport_collision/main.ts deleted file mode 100644 index 4bfcd89b1..000000000 --- a/tests/testdata/npm/cjs_reexport_collision/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -import ReExportCollision from "npm:@denotest/cjs-reexport-collision"; -ReExportCollision.default.sayHello(); diff --git a/tests/testdata/npm/cjs_require_esm/main.out b/tests/testdata/npm/cjs_require_esm/main.out deleted file mode 100644 index 4afceccc9..000000000 --- a/tests/testdata/npm/cjs_require_esm/main.out +++ /dev/null @@ -1,4 +0,0 @@ -[Module: null prototype] { - Test: [Module: null prototype] { Test: [class Test] }, - default: { Test: [Module: null prototype] { Test: [class Test] } } -} diff --git a/tests/testdata/npm/cjs_require_esm/main.ts b/tests/testdata/npm/cjs_require_esm/main.ts deleted file mode 100644 index 069d4b60e..000000000 --- a/tests/testdata/npm/cjs_require_esm/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as ns from "npm:@denotest/cjs-require-esm"; -console.log(ns); diff --git a/tests/testdata/npm/cjs_require_esm_mjs/main.out b/tests/testdata/npm/cjs_require_esm_mjs/main.out deleted file mode 100644 index 4afceccc9..000000000 --- a/tests/testdata/npm/cjs_require_esm_mjs/main.out +++ /dev/null @@ -1,4 +0,0 @@ -[Module: null prototype] { - Test: [Module: null prototype] { Test: [class Test] }, - default: { Test: [Module: null prototype] { Test: [class Test] } } -} diff --git a/tests/testdata/npm/cjs_require_esm_mjs/main.ts b/tests/testdata/npm/cjs_require_esm_mjs/main.ts deleted file mode 100644 index d753c2a83..000000000 --- a/tests/testdata/npm/cjs_require_esm_mjs/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as ns from "npm:@denotest/cjs-require-esm/require_mjs.js"; -console.log(ns); diff --git a/tests/testdata/npm/cjs_sub_path/main.js b/tests/testdata/npm/cjs_sub_path/main.js deleted file mode 100644 index b71360959..000000000 --- a/tests/testdata/npm/cjs_sub_path/main.js +++ /dev/null @@ -1,21 +0,0 @@ -// this package will require a subpath like "ajv/dist/compile/codegen" -// and also get the parent directory index.js file using require("..") -import Ajv from "npm:ajv@~8.11"; -import addFormats from "npm:ajv-formats@2.1.1"; -import { expect } from "npm:chai@4.3"; - -const ajv = new Ajv(); -addFormats(ajv); - -const schema = { - type: "string", - format: "date", - formatMinimum: "2016-02-06", - formatExclusiveMaximum: "2016-12-27", -}; -const validate = ajv.compile(schema); - -expect(validate("2016-02-06")).to.be.true; -expect(validate("2016-02-05")).to.be.false; - -console.log("Fini"); diff --git a/tests/testdata/npm/cjs_sub_path/main.out b/tests/testdata/npm/cjs_sub_path/main.out deleted file mode 100644 index 868733775..000000000 --- a/tests/testdata/npm/cjs_sub_path/main.out +++ /dev/null @@ -1,35 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/ajv -Download http://localhost:4260/ajv-formats -Download http://localhost:4260/chai -Download http://localhost:4260/fast-deep-equal -Download http://localhost:4260/json-schema-traverse -Download http://localhost:4260/require-from-string -Download http://localhost:4260/uri-js -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/punycode -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ajv/ajv-8.11.0.tgz -Download http://localhost:4260/ajv-formats/ajv-formats-2.1.1.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/fast-deep-equal/fast-deep-equal-3.1.3.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/json-schema-traverse/json-schema-traverse-1.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/punycode/punycode-2.1.1.tgz -Download http://localhost:4260/require-from-string/require-from-string-2.0.2.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Download http://localhost:4260/uri-js/uri-js-4.4.1.tgz -[UNORDERED_END] -Fini diff --git a/tests/testdata/npm/cjs_this_in_exports/main.js b/tests/testdata/npm/cjs_this_in_exports/main.js deleted file mode 100644 index 03aaabe05..000000000 --- a/tests/testdata/npm/cjs_this_in_exports/main.js +++ /dev/null @@ -1,11 +0,0 @@ -import defaultImport, { getValue } from "npm:@denotest/cjs-this-in-exports"; -import * as namespaceImport from "npm:@denotest/cjs-this-in-exports"; - -console.log(defaultImport.getValue()); -// In Node this actually fails, but it seems to work in Deno -// so I guess there's no harm in that. -console.log(namespaceImport.getValue()); - -// This will throw because it's lost its context. -// (same thing occurs with Node's cjs -> esm translation) -getValue(); diff --git a/tests/testdata/npm/cjs_this_in_exports/main.out b/tests/testdata/npm/cjs_this_in_exports/main.out deleted file mode 100644 index ba436bddc..000000000 --- a/tests/testdata/npm/cjs_this_in_exports/main.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -1 -error: Uncaught (in promise) TypeError: this.otherMethod is not a function - at getValue (file://[WILDCARD]/@denotest/cjs-this-in-exports/1.0.0/index.js:3:17) - at file://[WILDCARD]/testdata/npm/cjs_this_in_exports/main.js:11:1 diff --git a/tests/testdata/npm/cjs_yargs/main.js b/tests/testdata/npm/cjs_yargs/main.js deleted file mode 100644 index 832fd053c..000000000 --- a/tests/testdata/npm/cjs_yargs/main.js +++ /dev/null @@ -1,20 +0,0 @@ -import yargs from "npm:yargs@15.4.1"; - -const args = yargs(["serve", "8000"]) - .command("serve [port]", "start the server", (yargs) => { - return yargs - .positional("port", { - describe: "port to bind on", - default: 5000, - }); - }, (argv) => { - console.info(`start server on :${argv.port}`); - }) - .option("verbose", { - alias: "v", - type: "boolean", - description: "Run with verbose logging", - }) - .argv; - -console.log(args); diff --git a/tests/testdata/npm/cjs_yargs/main.out b/tests/testdata/npm/cjs_yargs/main.out deleted file mode 100644 index 938d7a771..000000000 --- a/tests/testdata/npm/cjs_yargs/main.out +++ /dev/null @@ -1,84 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/yargs -Download http://localhost:4260/cliui -Download http://localhost:4260/decamelize -Download http://localhost:4260/find-up -Download http://localhost:4260/get-caller-file -Download http://localhost:4260/require-directory -Download http://localhost:4260/require-main-filename -Download http://localhost:4260/set-blocking -Download http://localhost:4260/string-width -Download http://localhost:4260/which-module -Download http://localhost:4260/y18n -Download http://localhost:4260/yargs-parser -Download http://localhost:4260/strip-ansi -Download http://localhost:4260/wrap-ansi -Download http://localhost:4260/locate-path -Download http://localhost:4260/path-exists -Download http://localhost:4260/emoji-regex -Download http://localhost:4260/is-fullwidth-code-point -Download http://localhost:4260/camelcase -Download http://localhost:4260/ansi-regex -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/p-locate -Download http://localhost:4260/color-convert -Download http://localhost:4260/p-limit -Download http://localhost:4260/color-name -Download http://localhost:4260/p-try -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-regex/ansi-regex-5.0.1.tgz -Initialize ansi-regex@5.0.1 -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/camelcase/camelcase-5.3.1.tgz -Initialize camelcase@5.3.1 -Download http://localhost:4260/cliui/cliui-6.0.0.tgz -Initialize cliui@6.0.0 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/decamelize/decamelize-1.2.0.tgz -Initialize decamelize@1.2.0 -Download http://localhost:4260/emoji-regex/emoji-regex-8.0.0.tgz -Initialize emoji-regex@8.0.0 -Download http://localhost:4260/find-up/find-up-4.1.0.tgz -Initialize find-up@4.1.0 -Download http://localhost:4260/get-caller-file/get-caller-file-2.0.5.tgz -Initialize get-caller-file@2.0.5 -Download http://localhost:4260/is-fullwidth-code-point/is-fullwidth-code-point-3.0.0.tgz -Initialize is-fullwidth-code-point@3.0.0 -Download http://localhost:4260/locate-path/locate-path-5.0.0.tgz -Initialize locate-path@5.0.0 -Download http://localhost:4260/p-limit/p-limit-2.3.0.tgz -Initialize p-limit@2.3.0 -Download http://localhost:4260/p-locate/p-locate-4.1.0.tgz -Initialize p-locate@4.1.0 -Download http://localhost:4260/p-try/p-try-2.2.0.tgz -Initialize p-try@2.2.0 -Download http://localhost:4260/path-exists/path-exists-4.0.0.tgz -Initialize path-exists@4.0.0 -Download http://localhost:4260/require-directory/require-directory-2.1.1.tgz -Initialize require-directory@2.1.1 -Download http://localhost:4260/require-main-filename/require-main-filename-2.0.0.tgz -Initialize require-main-filename@2.0.0 -Download http://localhost:4260/set-blocking/set-blocking-2.0.0.tgz -Initialize set-blocking@2.0.0 -Download http://localhost:4260/string-width/string-width-4.2.3.tgz -Initialize string-width@4.2.3 -Download http://localhost:4260/strip-ansi/strip-ansi-6.0.1.tgz -Initialize strip-ansi@6.0.1 -Download http://localhost:4260/which-module/which-module-2.0.0.tgz -Initialize which-module@2.0.0 -Download http://localhost:4260/wrap-ansi/wrap-ansi-6.2.0.tgz -Initialize wrap-ansi@6.2.0 -Download http://localhost:4260/y18n/y18n-4.0.3.tgz -Initialize y18n@4.0.3 -Download http://localhost:4260/yargs/yargs-15.4.1.tgz -Initialize yargs@15.4.1 -Download http://localhost:4260/yargs-parser/yargs-parser-18.1.3.tgz -Initialize yargs-parser@18.1.3 -[UNORDERED_END] -start server on :8000 -[WILDCARD] diff --git a/tests/testdata/npm/compare_globals/main.out b/tests/testdata/npm/compare_globals/main.out deleted file mode 100644 index 234a68971..000000000 --- a/tests/testdata/npm/compare_globals/main.out +++ /dev/null @@ -1,30 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@types/node -Download http://localhost:4260/undici-types -Download http://localhost:4260/@denotest/globals -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/globals/1.0.0.tgz -Download http://localhost:4260/@types/node/node-22.5.4.tgz -Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz -[UNORDERED_END] -Check file:///[WILDCARD]/npm/compare_globals/main.ts -true -true -[] -setTimeout 1 false -setTimeout 2 function -setTimeout 3 function -setTimeout 4 function -setTimeout 5 undefined -window 1 false -window 2 false -false -false -self 1 true -self 2 true -false -false -bar -bar -true diff --git a/tests/testdata/npm/compare_globals/main.ts b/tests/testdata/npm/compare_globals/main.ts deleted file mode 100644 index 9482798d8..000000000 --- a/tests/testdata/npm/compare_globals/main.ts +++ /dev/null @@ -1,54 +0,0 @@ -/// <reference types="npm:@types/node" /> - -import * as globals from "npm:@denotest/globals"; -console.log(globals.global === globals.globalThis); -// @ts-expect-error even though these are the same object, they have different types -console.log(globals.globalThis === globalThis); -console.log(globals.process.execArgv); - -type AssertTrue<T extends true> = never; -type _TestNoProcessGlobal = AssertTrue< - typeof globalThis extends { process: any } ? false : true ->; -type _TestHasNodeJsGlobal = NodeJS.Architecture; - -const controller = new AbortController(); -controller.abort("reason"); // in the NodeJS declaration it doesn't have a reason - -// Some globals are not the same between Node and Deno. -// @ts-expect-error incompatible types between Node and Deno -console.log("setTimeout 1", globalThis.setTimeout === globals.getSetTimeout()); - -// Super edge case where some Node code deletes a global where the -// Node code has its own global and the Deno code has the same global, -// but it's different. Basically if some Node code deletes -// one of these globals then we don't want it to suddenly inherit -// the Deno global (or touch the Deno global at all). -console.log("setTimeout 2", typeof globalThis.setTimeout); -console.log("setTimeout 3", typeof globals.getSetTimeout()); -globals.deleteSetTimeout(); -console.log("setTimeout 4", typeof globalThis.setTimeout); -console.log("setTimeout 5", typeof globals.getSetTimeout()); - -// In Deno 2 and Node.js, the window global is not defined. -console.log("window 1", "window" in globalThis); -console.log( - "window 2", - Object.getOwnPropertyDescriptor(globalThis, "window") !== undefined, -); -globals.checkWindowGlobal(); - -// In Deno 2 self global is defined, but in Node it is not. -console.log("self 1", "self" in globalThis); -console.log( - "self 2", - Object.getOwnPropertyDescriptor(globalThis, "self") !== undefined, -); -globals.checkSelfGlobal(); - -// "Non-managed" globals are shared between Node and Deno. -(globalThis as any).foo = "bar"; -console.log((globalThis as any).foo); -console.log(globals.getFoo()); - -console.log(Reflect.ownKeys(globalThis).includes("console")); // non-enumerable keys are included diff --git a/tests/testdata/npm/create_require/main.out b/tests/testdata/npm/create_require/main.out deleted file mode 100644 index 70b0415b3..000000000 --- a/tests/testdata/npm/create_require/main.out +++ /dev/null @@ -1,12 +0,0 @@ -[WILDCARD] -function -function -function -function -function -function -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received https://example.com/ -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received https://example.com/ -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received 1 -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received foo -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ./foo diff --git a/tests/testdata/npm/create_require/main.ts b/tests/testdata/npm/create_require/main.ts deleted file mode 100644 index 625c734aa..000000000 --- a/tests/testdata/npm/create_require/main.ts +++ /dev/null @@ -1 +0,0 @@ -import "npm:@denotest/create-require@1.0.0"; diff --git a/tests/testdata/npm/d_ext/main.out b/tests/testdata/npm/d_ext/main.out deleted file mode 100644 index 5c22a76a0..000000000 --- a/tests/testdata/npm/d_ext/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/d-ext -Download http://localhost:4260/@denotest/d-ext/1.0.0.tgz -Check file:///[WILDCARD]/npm/d_ext/main.ts diff --git a/tests/testdata/npm/d_ext/main.ts b/tests/testdata/npm/d_ext/main.ts deleted file mode 100644 index c92dbe065..000000000 --- a/tests/testdata/npm/d_ext/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { test } from "npm:@denotest/d-ext"; - -console.log(test); diff --git a/tests/testdata/npm/deno_cache.out b/tests/testdata/npm/deno_cache.out deleted file mode 100644 index d723293a8..000000000 --- a/tests/testdata/npm/deno_cache.out +++ /dev/null @@ -1,8 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/mkdirp -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/chalk/chalk-5.0.1.tgz -Download http://localhost:4260/mkdirp/mkdirp-1.0.4.tgz -[UNORDERED_END] diff --git a/tests/testdata/npm/deno_run_no_bin_entrypoint.out b/tests/testdata/npm/deno_run_no_bin_entrypoint.out deleted file mode 100644 index 2b885ed59..000000000 --- a/tests/testdata/npm/deno_run_no_bin_entrypoint.out +++ /dev/null @@ -1 +0,0 @@ -error: Failed resolving binary export. '[WILDCARD]@denotest[WILDCARD]esm-basic[WILDCARD]package.json' did not have a bin property diff --git a/tests/testdata/npm/deno_run_no_bin_entrypoint_non_existent_subpath.out b/tests/testdata/npm/deno_run_no_bin_entrypoint_non_existent_subpath.out deleted file mode 100644 index 525fe4b4f..000000000 --- a/tests/testdata/npm/deno_run_no_bin_entrypoint_non_existent_subpath.out +++ /dev/null @@ -1,3 +0,0 @@ -error: Failed resolving binary export. '[WILDCARD]@denotest[WILDCARD]esm-basic[WILDCARD]package.json' did not have a bin property - -Fallback failed: Cannot find module 'file:///[WILDCARD]/non-existent.js' diff --git a/tests/testdata/npm/deno_run_no_ext.out b/tests/testdata/npm/deno_run_no_ext.out deleted file mode 100644 index ffe7cbd89..000000000 --- a/tests/testdata/npm/deno_run_no_ext.out +++ /dev/null @@ -1,4 +0,0 @@ -this -is -a -test diff --git a/tests/testdata/npm/deno_run_non_existent.out b/tests/testdata/npm/deno_run_non_existent.out deleted file mode 100644 index 247e650e6..000000000 --- a/tests/testdata/npm/deno_run_non_existent.out +++ /dev/null @@ -1,2 +0,0 @@ -Download http://localhost:4260/mkdirp -error: Could not find npm package 'mkdirp' matching '0.5.125'. diff --git a/tests/testdata/npm/deno_run_special_chars_in_bin_name.out b/tests/testdata/npm/deno_run_special_chars_in_bin_name.out deleted file mode 100644 index ffe7cbd89..000000000 --- a/tests/testdata/npm/deno_run_special_chars_in_bin_name.out +++ /dev/null @@ -1,4 +0,0 @@ -this -is -a -test diff --git a/tests/testdata/npm/directory_import/folder_index_js.out b/tests/testdata/npm/directory_import/folder_index_js.out deleted file mode 100644 index a700b8fdb..000000000 --- a/tests/testdata/npm/directory_import/folder_index_js.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/sub-folders -Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz -error: Directory import [WILDCARD]folder_index_js is not supported resolving import from file:///[WILDCARD]/directory_import/folder_index_js.ts -Did you mean to import index.js within the directory? - -Caused by: - [WILDCARD] diff --git a/tests/testdata/npm/directory_import/folder_index_js.ts b/tests/testdata/npm/directory_import/folder_index_js.ts deleted file mode 100644 index b0d51fcd9..000000000 --- a/tests/testdata/npm/directory_import/folder_index_js.ts +++ /dev/null @@ -1,2 +0,0 @@ -import test from "npm:@denotest/sub-folders/folder_index_js"; -console.log(test); diff --git a/tests/testdata/npm/directory_import/folder_no_index.out b/tests/testdata/npm/directory_import/folder_no_index.out deleted file mode 100644 index 844419b4c..000000000 --- a/tests/testdata/npm/directory_import/folder_no_index.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/@denotest/sub-folders -Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz -error: Directory import [WILDCARD]folder_no_index is not supported resolving import from file:///[WILDCARD]/folder_no_index.ts - -Caused by: - [WILDCARD] diff --git a/tests/testdata/npm/directory_import/folder_no_index.ts b/tests/testdata/npm/directory_import/folder_no_index.ts deleted file mode 100644 index 4c5fb7ec0..000000000 --- a/tests/testdata/npm/directory_import/folder_no_index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import test from "npm:@denotest/sub-folders/folder_no_index"; -console.log(test); diff --git a/tests/testdata/npm/dynamic_import_deno_ts_from_npm/add.ts b/tests/testdata/npm/dynamic_import_deno_ts_from_npm/add.ts deleted file mode 100644 index 3b399665d..000000000 --- a/tests/testdata/npm/dynamic_import_deno_ts_from_npm/add.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function add(a: number, b: number) { - return a + b; -} diff --git a/tests/testdata/npm/dynamic_import_deno_ts_from_npm/main.out b/tests/testdata/npm/dynamic_import_deno_ts_from_npm/main.out deleted file mode 100644 index 81d7aba8a..000000000 --- a/tests/testdata/npm/dynamic_import_deno_ts_from_npm/main.out +++ /dev/null @@ -1,2 +0,0 @@ -3 --1 diff --git a/tests/testdata/npm/dynamic_import_deno_ts_from_npm/main.ts b/tests/testdata/npm/dynamic_import_deno_ts_from_npm/main.ts deleted file mode 100644 index 4d5deec48..000000000 --- a/tests/testdata/npm/dynamic_import_deno_ts_from_npm/main.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { dynamicImport } from "npm:@denotest/dynamic-import"; - -const { add } = await dynamicImport(new URL("./add.ts", import.meta.url)); -console.log(add(1, 2)); -const { subtract } = await dynamicImport( - new URL("./subtract.mts", import.meta.url), -); -console.log(subtract(1, 2)); diff --git a/tests/testdata/npm/dynamic_import_deno_ts_from_npm/subtract.mts b/tests/testdata/npm/dynamic_import_deno_ts_from_npm/subtract.mts deleted file mode 100644 index 4bf634170..000000000 --- a/tests/testdata/npm/dynamic_import_deno_ts_from_npm/subtract.mts +++ /dev/null @@ -1,3 +0,0 @@ -export function subtract(a: number, b: number) { - return a - b; -} diff --git a/tests/testdata/npm/dynamic_import_invalid_package_name/main.out b/tests/testdata/npm/dynamic_import_invalid_package_name/main.out deleted file mode 100644 index 414d08795..000000000 --- a/tests/testdata/npm/dynamic_import_invalid_package_name/main.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/ws%3A -FAILED -TypeError: npm package 'ws:' does not exist. - at async file:///[WILDCARD]/dynamic_import_invalid_package_name/main.ts:2:3 { - code: "ERR_MODULE_NOT_FOUND" -} diff --git a/tests/testdata/npm/dynamic_import_invalid_package_name/main.ts b/tests/testdata/npm/dynamic_import_invalid_package_name/main.ts deleted file mode 100644 index 368ccc282..000000000 --- a/tests/testdata/npm/dynamic_import_invalid_package_name/main.ts +++ /dev/null @@ -1,6 +0,0 @@ -try { - await import(`npm:${"ws:"}`); -} catch (err) { - console.log("FAILED"); - console.log(err); -} diff --git a/tests/testdata/npm/dynamic_import_reload_same_package/main.out b/tests/testdata/npm/dynamic_import_reload_same_package/main.out deleted file mode 100644 index b2f99b465..000000000 --- a/tests/testdata/npm/dynamic_import_reload_same_package/main.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://localhost:4260/chalk -Download http://localhost:4260/chalk/chalk-5.0.1.tgz -Starting... -Ran other. -Finished... diff --git a/tests/testdata/npm/dynamic_import_reload_same_package/main.ts b/tests/testdata/npm/dynamic_import_reload_same_package/main.ts deleted file mode 100644 index 7c7ee7d55..000000000 --- a/tests/testdata/npm/dynamic_import_reload_same_package/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import chalk from "npm:chalk@5"; - -console.log(chalk.green("Starting...")); -// non-analyzable -const importName = "./other.ts"; -await import(importName); -console.log(chalk.green("Finished...")); diff --git a/tests/testdata/npm/dynamic_import_reload_same_package/other.ts b/tests/testdata/npm/dynamic_import_reload_same_package/other.ts deleted file mode 100644 index 28e3da14f..000000000 --- a/tests/testdata/npm/dynamic_import_reload_same_package/other.ts +++ /dev/null @@ -1,3 +0,0 @@ -import chalk from "npm:chalk@5"; - -console.log(chalk.green("Ran other.")); diff --git a/tests/testdata/npm/env_var_re_export/main.js b/tests/testdata/npm/env_var_re_export/main.js deleted file mode 100644 index ed91487a0..000000000 --- a/tests/testdata/npm/env_var_re_export/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { getEnv } from "npm:@denotest/env-var-re-export"; - -console.log(getEnv()); diff --git a/tests/testdata/npm/error_version_after_subpath/main.js b/tests/testdata/npm/error_version_after_subpath/main.js deleted file mode 100644 index 77c7a017c..000000000 --- a/tests/testdata/npm/error_version_after_subpath/main.js +++ /dev/null @@ -1 +0,0 @@ -import "npm:react-dom/server@18.2.0"; diff --git a/tests/testdata/npm/error_version_after_subpath/main.out b/tests/testdata/npm/error_version_after_subpath/main.out deleted file mode 100644 index 0cdd1b6da..000000000 --- a/tests/testdata/npm/error_version_after_subpath/main.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Invalid package specifier 'npm:react-dom/server@18.2.0'. Did you mean to write 'npm:react-dom@18.2.0/server'? - at [WILDCARD]/npm/error_version_after_subpath/main.js:1:8 diff --git a/tests/testdata/npm/file_dts_dmts_dcts/main.out b/tests/testdata/npm/file_dts_dmts_dcts/main.out deleted file mode 100644 index 507d2c2f7..000000000 --- a/tests/testdata/npm/file_dts_dmts_dcts/main.out +++ /dev/null @@ -1,24 +0,0 @@ -Download http://localhost:4260/@denotest/file-dts-dmts-dcts -Download http://localhost:4260/@denotest/file-dts-dmts-dcts/1.0.0.tgz -Check file:///[WILDCARD]/main.ts -error: TS2322 [ERROR]: Type '5' is not assignable to type '"dts"'. -const value1: Dts1 = 5; - ~~~~~~ - at file:///[WILDCARD] - -TS2322 [ERROR]: Type '5' is not assignable to type '"mts"'. -const value2: Mts1 = 5; - ~~~~~~ - at file:///[WILDCARD] - -TS2322 [ERROR]: Type '5' is not assignable to type '"mts"'. -const value3: Mts2 = 5; - ~~~~~~ - at file:///[WILDCARD] - -TS2322 [ERROR]: Type '5' is not assignable to type '"cts"'. -const value4: Cts1 = 5; - ~~~~~~ - at file:///[WILDCARD] - -Found 4 errors. diff --git a/tests/testdata/npm/file_dts_dmts_dcts/main.ts b/tests/testdata/npm/file_dts_dmts_dcts/main.ts deleted file mode 100644 index 63686e2d3..000000000 --- a/tests/testdata/npm/file_dts_dmts_dcts/main.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Value as Dts1 } from "npm:@denotest/file-dts-dmts-dcts/js"; -import { Value as Mts1 } from "npm:@denotest/file-dts-dmts-dcts"; -import { Value as Mts2 } from "npm:@denotest/file-dts-dmts-dcts/mjs"; -import { Value as Cts1 } from "npm:@denotest/file-dts-dmts-dcts/cjs"; - -const value1: Dts1 = 5; -const value2: Mts1 = 5; -const value3: Mts2 = 5; -const value4: Cts1 = 5; diff --git a/tests/testdata/npm/import_json/main.js b/tests/testdata/npm/import_json/main.js deleted file mode 100644 index ac6cee9a8..000000000 --- a/tests/testdata/npm/import_json/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import json from "npm:@denotest/binary-package@1/package.json" with { - type: "json", -}; -console.log(json); diff --git a/tests/testdata/npm/import_json/main.out b/tests/testdata/npm/import_json/main.out deleted file mode 100644 index 7db7ec4ea..000000000 --- a/tests/testdata/npm/import_json/main.out +++ /dev/null @@ -1,10 +0,0 @@ -{ - name: "@denotest/binary-package", - version: "1.0.0", - main: "index.js", - optionalDependencies: { - "@denotest/binary-package-linux": "1.0.0", - "@denotest/binary-package-mac": "1.0.0", - "@denotest/binary-package-windows": "1.0.0" - } -} diff --git a/tests/testdata/npm/import_map/import_map.json b/tests/testdata/npm/import_map/import_map.json deleted file mode 100644 index 1c3baacd1..000000000 --- a/tests/testdata/npm/import_map/import_map.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "imports": { - "chalk": "npm:chalk@5", - "@denotest/": "npm:/@denotest/dual-cjs-esm/" - } -} diff --git a/tests/testdata/npm/import_map/main.js b/tests/testdata/npm/import_map/main.js deleted file mode 100644 index e354b7e92..000000000 --- a/tests/testdata/npm/import_map/main.js +++ /dev/null @@ -1,10 +0,0 @@ -import chalk from "chalk"; -import { getSubPathKind } from "@denotest/subpath/main.mjs"; - -console.log(chalk.green("chalk import map loads")); - -export function test(value) { - return chalk.red(value); -} - -console.log(getSubPathKind()); diff --git a/tests/testdata/npm/import_map/main.out b/tests/testdata/npm/import_map/main.out deleted file mode 100644 index 05f313d4e..000000000 --- a/tests/testdata/npm/import_map/main.out +++ /dev/null @@ -1,10 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/@denotest/dual-cjs-esm -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz -Download http://localhost:4260/chalk/chalk-5.0.1.tgz -[UNORDERED_END] -chalk import map loads -esm diff --git a/tests/testdata/npm/imports_package_json/import_not_defined.js b/tests/testdata/npm/imports_package_json/import_not_defined.js deleted file mode 100644 index dc4d2df16..000000000 --- a/tests/testdata/npm/imports_package_json/import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/import-not-defined"; - -console.log(data); diff --git a/tests/testdata/npm/imports_package_json/import_not_defined.out b/tests/testdata/npm/imports_package_json/import_not_defined.out deleted file mode 100644 index 70d1145a3..000000000 --- a/tests/testdata/npm/imports_package_json/import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/testdata/npm/imports_package_json/main.js b/tests/testdata/npm/imports_package_json/main.js deleted file mode 100644 index 53090dd94..000000000 --- a/tests/testdata/npm/imports_package_json/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import data from "@denotest/imports-package-json"; - -console.log(data.hi); -console.log(data.bye); -console.log(typeof data.fs.readFile); -console.log(typeof data.path.join); -console.log(typeof data.fs2.writeFile); diff --git a/tests/testdata/npm/imports_package_json/main.out b/tests/testdata/npm/imports_package_json/main.out deleted file mode 100644 index 979e35576..000000000 --- a/tests/testdata/npm/imports_package_json/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -hi -bye -function -function -function diff --git a/tests/testdata/npm/imports_package_json/package.json b/tests/testdata/npm/imports_package_json/package.json deleted file mode 100644 index cb6a08d1a..000000000 --- a/tests/testdata/npm/imports_package_json/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "my-test", - "dependencies": { - "@denotest/imports-package-json": "1.0.0" - } -} diff --git a/tests/testdata/npm/imports_package_json/sub_path_import_not_defined.js b/tests/testdata/npm/imports_package_json/sub_path_import_not_defined.js deleted file mode 100644 index f1097aa06..000000000 --- a/tests/testdata/npm/imports_package_json/sub_path_import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/sub-path-import-not-defined"; - -console.log(data); diff --git a/tests/testdata/npm/imports_package_json/sub_path_import_not_defined.out b/tests/testdata/npm/imports_package_json/sub_path_import_not_defined.out deleted file mode 100644 index 7c803f2bf..000000000 --- a/tests/testdata/npm/imports_package_json/sub_path_import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/testdata/npm/info/chalk.out b/tests/testdata/npm/info/chalk.out deleted file mode 100644 index 63fa20da5..000000000 --- a/tests/testdata/npm/info/chalk.out +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: 5 unique -size: [WILDCARD] - -npm:/chalk@4.1.2 ([WILDCARD]) -├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ └── npm:/color-name@1.1.4 ([WILDCARD]) -└─┬ npm:/supports-color@7.2.0 ([WILDCARD]) - └── npm:/has-flag@4.0.0 ([WILDCARD]) diff --git a/tests/testdata/npm/info/chalk_json.out b/tests/testdata/npm/info/chalk_json.out deleted file mode 100644 index d54155270..000000000 --- a/tests/testdata/npm/info/chalk_json.out +++ /dev/null @@ -1,57 +0,0 @@ -{ - "roots": [ - "npm:chalk@4" - ], - "modules": [ - { - "kind": "npm", - "specifier": "npm:/chalk@4.1.2", - "npmPackage": "chalk@4.1.2" - } - ], - "redirects": { - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "version": 1, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - } - } -} diff --git a/tests/testdata/npm/mixed_case_package_name/global.out b/tests/testdata/npm/mixed_case_package_name/global.out deleted file mode 100644 index fdacea385..000000000 --- a/tests/testdata/npm/mixed_case_package_name/global.out +++ /dev/null @@ -1,9 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz -Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz -[UNORDERED_END] -5 diff --git a/tests/testdata/npm/mixed_case_package_name/global.ts b/tests/testdata/npm/mixed_case_package_name/global.ts deleted file mode 100644 index a721b3d78..000000000 --- a/tests/testdata/npm/mixed_case_package_name/global.ts +++ /dev/null @@ -1,2 +0,0 @@ -import value from "npm:@denotest/MixedCase"; -console.log(value); diff --git a/tests/testdata/npm/mixed_case_package_name/local.out b/tests/testdata/npm/mixed_case_package_name/local.out deleted file mode 100644 index 6ab989d80..000000000 --- a/tests/testdata/npm/mixed_case_package_name/local.out +++ /dev/null @@ -1,13 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz -Initialize @denotest/CAPITALS@1.0.0 -Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz -Initialize @denotest/MixedCase@1.0.0 -[UNORDERED_END] -5 -true -true diff --git a/tests/testdata/npm/mixed_case_package_name/local.ts b/tests/testdata/npm/mixed_case_package_name/local.ts deleted file mode 100644 index 6ca6cb581..000000000 --- a/tests/testdata/npm/mixed_case_package_name/local.ts +++ /dev/null @@ -1,18 +0,0 @@ -import value from "npm:@denotest/MixedCase"; -console.log(value); -console.log(pathExists("./node_modules/.deno")); -console.log( - pathExists("./node_modules/.deno/_ibsgk3tporsxg5bpinavaskuifgfg@1.0.0"), -); - -function pathExists(filePath: string) { - try { - Deno.lstatSync(filePath); - return true; - } catch (error) { - if (error instanceof Deno.errors.NotFound) { - return false; - } - throw error; - } -} diff --git a/tests/testdata/npm/node_modules_deno_node_modules/main.out b/tests/testdata/npm/node_modules_deno_node_modules/main.out deleted file mode 100644 index 1ebdb2dd5..000000000 --- a/tests/testdata/npm/node_modules_deno_node_modules/main.out +++ /dev/null @@ -1,2 +0,0 @@ -esm -esm diff --git a/tests/testdata/npm/node_modules_deno_node_modules/main.ts b/tests/testdata/npm/node_modules_deno_node_modules/main.ts deleted file mode 100644 index 6e4a32d8e..000000000 --- a/tests/testdata/npm/node_modules_deno_node_modules/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { getKind as getKind1 } from "npm:@denotest/dual-cjs-esm-dep"; -// this should still be able to be resolved even though it's missing the -// "@denotest/dual-cjs-esm" package because the above import will resolve it -import { getKind as getKind2 } from "npm:@denotest/dual-cjs-esm-dep-missing"; - -console.log(getKind1()); -console.log(getKind2()); diff --git a/tests/testdata/npm/nonexistent_file/main.js b/tests/testdata/npm/nonexistent_file/main.js deleted file mode 100644 index c480b0548..000000000 --- a/tests/testdata/npm/nonexistent_file/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import hmacSHA512 from "npm:crypto-js/non-existent"; -console.log(hmacSHA512); diff --git a/tests/testdata/npm/nonexistent_file/main.out b/tests/testdata/npm/nonexistent_file/main.out deleted file mode 100644 index baa79b1ce..000000000 --- a/tests/testdata/npm/nonexistent_file/main.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Unable to load [WILDCARD]non-existent imported from [WILDCARD]main.js - -Caused by: -[WILDCARD] diff --git a/tests/testdata/npm/permissions_outside_package/foo/config.js b/tests/testdata/npm/permissions_outside_package/foo/config.js deleted file mode 100644 index e667790d2..000000000 --- a/tests/testdata/npm/permissions_outside_package/foo/config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - "name": "foobar", - "version": "0.0.1", -}; diff --git a/tests/testdata/npm/permissions_outside_package/foo/package.json b/tests/testdata/npm/permissions_outside_package/foo/package.json deleted file mode 100644 index cc049e6ce..000000000 --- a/tests/testdata/npm/permissions_outside_package/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foobar", - "version": "0.0.1" -} diff --git a/tests/testdata/npm/permissions_outside_package/main.out b/tests/testdata/npm/permissions_outside_package/main.out deleted file mode 100644 index 089f329c4..000000000 --- a/tests/testdata/npm/permissions_outside_package/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/permissions-outside-package -Download http://localhost:4260/@denotest/permissions-outside-package/1.0.0.tgz -{ name: "foobar", version: "0.0.1" } diff --git a/tests/testdata/npm/permissions_outside_package/main.ts b/tests/testdata/npm/permissions_outside_package/main.ts deleted file mode 100644 index b0b82b626..000000000 --- a/tests/testdata/npm/permissions_outside_package/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { loadConfigFile } from "npm:@denotest/permissions-outside-package"; - -const fileName = `${Deno.cwd()}/npm/permissions_outside_package/foo/config.js`; -const config = loadConfigFile(fileName); -console.log(config); diff --git a/tests/testdata/npm/remote_npm_specifier/main.out b/tests/testdata/npm/remote_npm_specifier/main.out deleted file mode 100644 index 9daeafb98..000000000 --- a/tests/testdata/npm/remote_npm_specifier/main.out +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/tests/testdata/npm/remote_npm_specifier/main.ts b/tests/testdata/npm/remote_npm_specifier/main.ts deleted file mode 100644 index 20a99b688..000000000 --- a/tests/testdata/npm/remote_npm_specifier/main.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/npm/remote_npm_specifier/remote.ts"; diff --git a/tests/testdata/npm/remote_npm_specifier/remote.ts b/tests/testdata/npm/remote_npm_specifier/remote.ts deleted file mode 100644 index 923ed3ed8..000000000 --- a/tests/testdata/npm/remote_npm_specifier/remote.ts +++ /dev/null @@ -1,3 +0,0 @@ -import chalk from "npm:chalk"; - -console.log(chalk.green("test")); diff --git a/tests/testdata/npm/require_added_nm_folder/main.js b/tests/testdata/npm/require_added_nm_folder/main.js deleted file mode 100644 index 723b2023a..000000000 --- a/tests/testdata/npm/require_added_nm_folder/main.js +++ /dev/null @@ -1,10 +0,0 @@ -import { getValue } from "npm:@denotest/require-added-nm-folder"; - -Deno.mkdirSync("./node_modules/.other-package"); -Deno.writeTextFileSync("./node_modules/.other-package/package.json", "{}"); -Deno.writeTextFileSync( - "./node_modules/.other-package/index.js", - "exports.get = () => 5;", -); - -console.log(getValue()); diff --git a/tests/testdata/npm/require_added_nm_folder/main.out b/tests/testdata/npm/require_added_nm_folder/main.out deleted file mode 100644 index 7ed6ff82d..000000000 --- a/tests/testdata/npm/require_added_nm_folder/main.out +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/tests/testdata/npm/require_json/main.js b/tests/testdata/npm/require_json/main.js deleted file mode 100644 index d11e85305..000000000 --- a/tests/testdata/npm/require_json/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import globals from "npm:globals@13.17.0"; -console.log(globals); diff --git a/tests/testdata/npm/require_json/main.out b/tests/testdata/npm/require_json/main.out deleted file mode 100644 index 97db68e1b..000000000 --- a/tests/testdata/npm/require_json/main.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] - devtools: { -[WILDCARD]
\ No newline at end of file diff --git a/tests/testdata/npm/require_main/main.js b/tests/testdata/npm/require_main/main.js deleted file mode 100644 index ddecd4fdb..000000000 --- a/tests/testdata/npm/require_main/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import fraction from "npm:autoprefixer"; -console.log(typeof fraction); diff --git a/tests/testdata/npm/require_main/main.out b/tests/testdata/npm/require_main/main.out deleted file mode 100644 index e2dbde096..000000000 --- a/tests/testdata/npm/require_main/main.out +++ /dev/null @@ -1 +0,0 @@ -function diff --git a/tests/testdata/npm/reserved_word_exports/main.out b/tests/testdata/npm/reserved_word_exports/main.out deleted file mode 100644 index ccfd35bc8..000000000 --- a/tests/testdata/npm/reserved_word_exports/main.out +++ /dev/null @@ -1,141 +0,0 @@ -Download http://localhost:4260/@denotest/reserved-word-exports -Download http://localhost:4260/@denotest/reserved-word-exports/1.0.0.tgz -[Module: null prototype] { - abstract: "abstract", - arguments: "arguments", - async: "async", - await: "await", - boolean: "boolean", - break: "break", - byte: "byte", - case: "case", - catch: "catch", - char: "char", - class: "class", - const: "const", - continue: "continue", - debugger: "debugger", - default: { - abstract: "abstract", - arguments: "arguments", - async: "async", - await: "await", - boolean: "boolean", - break: "break", - byte: "byte", - case: "case", - catch: "catch", - char: "char", - class: "class", - const: "const", - continue: "continue", - debugger: "debugger", - default: "default", - delete: "delete", - do: "do", - double: "double", - else: "else", - enum: "enum", - eval: "eval", - export: "export", - extends: "extends", - false: "false", - final: "final", - finally: "finally", - float: "float", - for: "for", - function: "function", - get: "get", - goto: "goto", - if: "if", - implements: "implements", - import: "import", - in: "in", - instanceof: "instanceof", - int: "int", - interface: "interface", - let: "let", - long: "long", - mod: "mod", - native: "native", - new: "new", - null: "null", - package: "package", - private: "private", - protected: "protected", - public: "public", - return: "return", - set: "set", - short: "short", - static: "static", - super: "super", - switch: "switch", - synchronized: "synchronized", - this: "this", - throw: "throw", - throws: "throws", - transient: "transient", - true: "true", - try: "try", - typeof: "typeof", - var: "var", - void: "void", - volatile: "volatile", - while: "while", - with: "with", - yield: "yield" - }, - delete: "delete", - do: "do", - double: "double", - else: "else", - enum: "enum", - eval: "eval", - export: "export", - extends: "extends", - false: "false", - final: "final", - finally: "finally", - float: "float", - for: "for", - function: "function", - get: "get", - goto: "goto", - if: "if", - implements: "implements", - import: "import", - in: "in", - instanceof: "instanceof", - int: "int", - interface: "interface", - let: "let", - long: "long", - mod: "mod", - native: "native", - new: "new", - null: "null", - package: "package", - private: "private", - protected: "protected", - public: "public", - return: "return", - set: "set", - short: "short", - static: "static", - super: "super", - switch: "switch", - synchronized: "synchronized", - this: "this", - throw: "throw", - throws: "throws", - transient: "transient", - true: "true", - try: "try", - typeof: "typeof", - var: "var", - void: "void", - volatile: "volatile", - while: "while", - with: "with", - yield: "yield" -} diff --git a/tests/testdata/npm/reserved_word_exports/main.ts b/tests/testdata/npm/reserved_word_exports/main.ts deleted file mode 100644 index 33cf183d3..000000000 --- a/tests/testdata/npm/reserved_word_exports/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as exports from "npm:@denotest/reserved-word-exports"; - -console.log(exports); diff --git a/tests/testdata/npm/run_existing_npm_package_with_subpath/main.out b/tests/testdata/npm/run_existing_npm_package_with_subpath/main.out deleted file mode 100644 index f6ee03ef1..000000000 --- a/tests/testdata/npm/run_existing_npm_package_with_subpath/main.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://localhost:4260/@denotest/bin -Download http://localhost:4260/@denotest/bin/1.0.0.tgz -Initialize @denotest/bin@1.0.0 -dev ---help diff --git a/tests/testdata/npm/run_existing_npm_package_with_subpath/package.json b/tests/testdata/npm/run_existing_npm_package_with_subpath/package.json deleted file mode 100644 index e9a7e84ce..000000000 --- a/tests/testdata/npm/run_existing_npm_package_with_subpath/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "run-existing-npm-package", - "dependencies": { - "@denotest/bin": "1.0.0" - } -} diff --git a/tests/testdata/npm/sub_paths/main.jsx b/tests/testdata/npm/sub_paths/main.jsx deleted file mode 100644 index 0c712b9ff..000000000 --- a/tests/testdata/npm/sub_paths/main.jsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from "npm:react@18.2.0"; -import { renderToString } from "npm:react-dom@18.2.0/server"; - -function App({ name }) { - return <div>Hello {name}!</div>; -} - -console.log(renderToString(<App name="World" />)); diff --git a/tests/testdata/npm/sub_paths/main.out b/tests/testdata/npm/sub_paths/main.out deleted file mode 100644 index f034585a7..000000000 --- a/tests/testdata/npm/sub_paths/main.out +++ /dev/null @@ -1 +0,0 @@ -<div>Hello <!-- -->World<!-- -->!</div> diff --git a/tests/testdata/npm/tarball_with_global_header/main.js b/tests/testdata/npm/tarball_with_global_header/main.js deleted file mode 100644 index d1bb40fbc..000000000 --- a/tests/testdata/npm/tarball_with_global_header/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { Client } from "npm:ssh2"; - -console.log(Client); diff --git a/tests/testdata/npm/tarball_with_global_header/main.out b/tests/testdata/npm/tarball_with_global_header/main.out deleted file mode 100644 index ff211087b..000000000 --- a/tests/testdata/npm/tarball_with_global_header/main.out +++ /dev/null @@ -1 +0,0 @@ -[class Client extends EventEmitter] diff --git a/tests/testdata/npm/translate_cjs_to_esm/main.js b/tests/testdata/npm/translate_cjs_to_esm/main.js deleted file mode 100644 index 04a86fbf1..000000000 --- a/tests/testdata/npm/translate_cjs_to_esm/main.js +++ /dev/null @@ -1,6 +0,0 @@ -import fsx from "npm:fs-extra@10.1.0"; -import { createApp } from "npm:vue"; -import "npm:@denotest/cjs-with-file-stem"; - -console.log(fsx.access); -console.log(createApp); diff --git a/tests/testdata/npm/translate_cjs_to_esm/main.out b/tests/testdata/npm/translate_cjs_to_esm/main.out deleted file mode 100644 index c21a965b8..000000000 --- a/tests/testdata/npm/translate_cjs_to_esm/main.out +++ /dev/null @@ -1,4 +0,0 @@ -hello -world -[Function: access] -[Function: createApp] diff --git a/tests/testdata/npm/types_ambient_module/import_map.json b/tests/testdata/npm/types_ambient_module/import_map.json deleted file mode 100644 index f61d99b47..000000000 --- a/tests/testdata/npm/types_ambient_module/import_map.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "types-ambient": "npm:@denotest/types-ambient" - } -} diff --git a/tests/testdata/npm/types_ambient_module/main.out b/tests/testdata/npm/types_ambient_module/main.out deleted file mode 100644 index c84130707..000000000 --- a/tests/testdata/npm/types_ambient_module/main.out +++ /dev/null @@ -1,21 +0,0 @@ -error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(import1.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/types_ambient_module/main.ts:5:21 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 - -TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(import2.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/types_ambient_module/main.ts:7:21 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 - -Found 2 errors. diff --git a/tests/testdata/npm/types_ambient_module/main.ts b/tests/testdata/npm/types_ambient_module/main.ts deleted file mode 100644 index 8f77cabe8..000000000 --- a/tests/testdata/npm/types_ambient_module/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as import1 from "npm:@denotest/types-ambient"; -import * as import2 from "npm:@denotest/types-ambient@1"; - -console.log(import1.Test); -console.log(import1.Test2); // should error -console.log(import2.Test); -console.log(import2.Test2); // should error diff --git a/tests/testdata/npm/types_ambient_module/main_import_map.out b/tests/testdata/npm/types_ambient_module/main_import_map.out deleted file mode 100644 index 548f9b479..000000000 --- a/tests/testdata/npm/types_ambient_module/main_import_map.out +++ /dev/null @@ -1,9 +0,0 @@ -error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(mod.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/main_import_map.ts:4:17 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 diff --git a/tests/testdata/npm/types_ambient_module/main_import_map.ts b/tests/testdata/npm/types_ambient_module/main_import_map.ts deleted file mode 100644 index 2694c94b7..000000000 --- a/tests/testdata/npm/types_ambient_module/main_import_map.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as mod from "npm:@denotest/types-ambient"; - -console.log(mod.Test); -console.log(mod.Test2); // should error diff --git a/tests/testdata/npm/types_entry_value_not_exists/main.out b/tests/testdata/npm/types_entry_value_not_exists/main.out deleted file mode 100644 index 017a17ea2..000000000 --- a/tests/testdata/npm/types_entry_value_not_exists/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/types-entry-value-not-exists -Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz -Check file://[WILDCARD]/types_entry_value_not_exists/main.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const result: string = getValue(); - ~~~~~~ - at file:///[WILDCARD]/main.ts:4:7 diff --git a/tests/testdata/npm/types_entry_value_not_exists/main.ts b/tests/testdata/npm/types_entry_value_not_exists/main.ts deleted file mode 100644 index 04374ef87..000000000 --- a/tests/testdata/npm/types_entry_value_not_exists/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getValue } from "npm:@denotest/types-entry-value-not-exists"; - -// should error here -const result: string = getValue(); -console.log(result); diff --git a/tests/testdata/npm/types_exports_import_types/main.out b/tests/testdata/npm/types_exports_import_types/main.out deleted file mode 100644 index 10f9425ca..000000000 --- a/tests/testdata/npm/types_exports_import_types/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/types-exports-import-types -Download http://localhost:4260/@denotest/types-exports-import-types/1.0.0.tgz -Check file://[WILDCARD]/types_exports_import_types/main.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const result: string = getValue(); - ~~~~~~ - at file:///[WILDCARD]/main.ts:4:7 diff --git a/tests/testdata/npm/types_exports_import_types/main.ts b/tests/testdata/npm/types_exports_import_types/main.ts deleted file mode 100644 index 3ae3e92a3..000000000 --- a/tests/testdata/npm/types_exports_import_types/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getValue } from "npm:@denotest/types-exports-import-types"; - -// should error here -const result: string = getValue(); -console.log(result); diff --git a/tests/testdata/npm/types_no_types_entry/main.out b/tests/testdata/npm/types_no_types_entry/main.out deleted file mode 100644 index 53e872eaf..000000000 --- a/tests/testdata/npm/types_no_types_entry/main.out +++ /dev/null @@ -1,13 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/types-no-types-entry -Download http://localhost:4260/@denotest/types-entry-value-not-exists -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz -Download http://localhost:4260/@denotest/types-no-types-entry/1.0.0.tgz -[UNORDERED_END] -Check file://[WILDCARD]/types_no_types_entry/main.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const result: string = getValue(); - ~~~~~~ - at file:///[WILDCARD]/main.ts:4:7 diff --git a/tests/testdata/npm/types_no_types_entry/main.ts b/tests/testdata/npm/types_no_types_entry/main.ts deleted file mode 100644 index eef53b681..000000000 --- a/tests/testdata/npm/types_no_types_entry/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getValue } from "npm:@denotest/types-no-types-entry"; - -// should error here -const result: string = getValue(); -console.log(result); diff --git a/tests/testdata/npm/typescript_file_in_package/main.out b/tests/testdata/npm/typescript_file_in_package/main.out deleted file mode 100644 index 3c3b97190..000000000 --- a/tests/testdata/npm/typescript_file_in_package/main.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/@denotest/typescript-file -Download http://localhost:4260/@denotest/typescript-file/1.0.0.tgz -error: Could not resolve 'npm:@denotest/typescript-file@1.0.0'. - -Caused by: - TypeScript files are not supported in npm packages: file:///[WILDCARD]/@denotest/typescript-file/1.0.0/index.ts diff --git a/tests/testdata/npm/typescript_file_in_package/main.ts b/tests/testdata/npm/typescript_file_in_package/main.ts deleted file mode 100644 index aefc38ebe..000000000 --- a/tests/testdata/npm/typescript_file_in_package/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -// We don't support typescript files in npm packages because we don't -// want to encourage people distributing npm packages that aren't JavaScript. -import { getValue } from "npm:@denotest/typescript-file"; - -console.log(getValue()); |