From b3ca3b2f25931afb350027bde87dc3d4f9a741b0 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 13 Mar 2024 12:21:13 -0400 Subject: chore: rough first pass on spec tests (#22877) --- tests/testdata/cache/036_import_map_fetch.out | 0 tests/testdata/import_maps/config.json | 15 -------------- tests/testdata/import_maps/import_map.json | 15 -------------- tests/testdata/import_maps/import_map_invalid.json | 7 ------- tests/testdata/import_maps/import_map_remote.json | 3 ++- tests/testdata/import_maps/scope/scoped.ts | 2 -- tests/testdata/import_maps/scoped_moment.ts | 1 - tests/testdata/info/031_info_ts_error.out | 6 ------ tests/testdata/info/031_info_ts_error.ts | 1 - tests/testdata/info/065_import_map_info.out | 6 ------ tests/testdata/npm/conditional_exports/main.js | 15 -------------- tests/testdata/npm/conditional_exports/main.out | 19 ------------------ .../npm/conditional_exports/main_node_modules.out | 23 ---------------------- tests/testdata/npm/esm/main.js | 9 --------- tests/testdata/npm/esm/main.out | 3 --- tests/testdata/npm/esm/test.js | 5 ----- tests/testdata/npm/esm/test.out | 11 ----------- tests/testdata/run/026_redirect_javascript.js | 2 -- tests/testdata/run/026_redirect_javascript.js.out | 1 - tests/testdata/run/033_import_map.out | 7 ------- .../testdata/run/033_import_map_in_config_file.out | 8 -------- .../run/033_import_map_in_flag_has_precedence.out | 1 - .../run/092_import_map_unmapped_bare_specifier.ts | 1 - .../092_import_map_unmapped_bare_specifier.ts.out | 6 ------ 24 files changed, 2 insertions(+), 165 deletions(-) delete mode 100644 tests/testdata/cache/036_import_map_fetch.out delete mode 100644 tests/testdata/import_maps/config.json delete mode 100644 tests/testdata/import_maps/import_map.json delete mode 100644 tests/testdata/import_maps/import_map_invalid.json delete mode 100644 tests/testdata/import_maps/scope/scoped.ts delete mode 100644 tests/testdata/import_maps/scoped_moment.ts delete mode 100644 tests/testdata/info/031_info_ts_error.out delete mode 100644 tests/testdata/info/031_info_ts_error.ts delete mode 100644 tests/testdata/info/065_import_map_info.out delete mode 100644 tests/testdata/npm/conditional_exports/main.js delete mode 100644 tests/testdata/npm/conditional_exports/main.out delete mode 100644 tests/testdata/npm/conditional_exports/main_node_modules.out delete mode 100644 tests/testdata/npm/esm/main.js delete mode 100644 tests/testdata/npm/esm/main.out delete mode 100644 tests/testdata/npm/esm/test.js delete mode 100644 tests/testdata/npm/esm/test.out delete mode 100644 tests/testdata/run/026_redirect_javascript.js delete mode 100644 tests/testdata/run/026_redirect_javascript.js.out delete mode 100644 tests/testdata/run/033_import_map.out delete mode 100644 tests/testdata/run/033_import_map_in_config_file.out delete mode 100644 tests/testdata/run/033_import_map_in_flag_has_precedence.out delete mode 100644 tests/testdata/run/092_import_map_unmapped_bare_specifier.ts delete mode 100644 tests/testdata/run/092_import_map_unmapped_bare_specifier.ts.out (limited to 'tests/testdata') diff --git a/tests/testdata/cache/036_import_map_fetch.out b/tests/testdata/cache/036_import_map_fetch.out deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testdata/import_maps/config.json b/tests/testdata/import_maps/config.json deleted file mode 100644 index b296a63c7..000000000 --- a/tests/testdata/import_maps/config.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "importMap": "./import_map.json", - "imports": { - "moment": "./moment/moment.ts", - "moment/": "./moment/", - "lodash": "./lodash/lodash.ts", - "lodash/": "./lodash/", - "https://www.unpkg.com/vue/dist/vue.runtime.esm.js": "./vue.ts" - }, - "scopes": { - "scope/": { - "moment": "./scoped_moment.ts" - } - } -} diff --git a/tests/testdata/import_maps/import_map.json b/tests/testdata/import_maps/import_map.json deleted file mode 100644 index 40d1d4ec2..000000000 --- a/tests/testdata/import_maps/import_map.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "imports": { - "print_hello": "./print_hello.ts", - "moment": "./moment/moment.ts", - "moment/": "./moment/", - "lodash": "./lodash/lodash.ts", - "lodash/": "./lodash/", - "https://www.unpkg.com/vue/dist/vue.runtime.esm.js": "./vue.ts" - }, - "scopes": { - "scope/": { - "moment": "./scoped_moment.ts" - } - } -} diff --git a/tests/testdata/import_maps/import_map_invalid.json b/tests/testdata/import_maps/import_map_invalid.json deleted file mode 100644 index a09d280c5..000000000 --- a/tests/testdata/import_maps/import_map_invalid.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "https://www.unpkg.com/vue/dist/vue.runtime.esm.js": "./vue.ts" - }, - "scopes": { - } -} diff --git a/tests/testdata/import_maps/import_map_remote.json b/tests/testdata/import_maps/import_map_remote.json index 51f90f69c..190fc4f55 100644 --- a/tests/testdata/import_maps/import_map_remote.json +++ b/tests/testdata/import_maps/import_map_remote.json @@ -4,6 +4,7 @@ "moment/": "./moment/", "lodash": "./lodash/lodash.ts", "lodash/": "./lodash/", - "https://www.unpkg.com/vue/dist/vue.runtime.esm.js": "./vue.ts" + "https://www.unpkg.com/vue/dist/vue.runtime.esm.js": "./vue.ts", + "print_hello": "./print_hello.ts" } } diff --git a/tests/testdata/import_maps/scope/scoped.ts b/tests/testdata/import_maps/scope/scoped.ts deleted file mode 100644 index 9a0b5d8e3..000000000 --- a/tests/testdata/import_maps/scope/scoped.ts +++ /dev/null @@ -1,2 +0,0 @@ -import "moment"; -console.log("Hello from scoped!"); diff --git a/tests/testdata/import_maps/scoped_moment.ts b/tests/testdata/import_maps/scoped_moment.ts deleted file mode 100644 index 9f67f88d4..000000000 --- a/tests/testdata/import_maps/scoped_moment.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello from scoped moment!"); diff --git a/tests/testdata/info/031_info_ts_error.out b/tests/testdata/info/031_info_ts_error.out deleted file mode 100644 index 81edd0032..000000000 --- a/tests/testdata/info/031_info_ts_error.out +++ /dev/null @@ -1,6 +0,0 @@ -local: [WILDCARD]031_info_ts_error.ts -type: TypeScript -dependencies: 0 unique -size: [WILDCARD] - -[WILDCARD]031_info_ts_error.ts ([WILDCARD]) diff --git a/tests/testdata/info/031_info_ts_error.ts b/tests/testdata/info/031_info_ts_error.ts deleted file mode 100644 index 9b7492dbe..000000000 --- a/tests/testdata/info/031_info_ts_error.ts +++ /dev/null @@ -1 +0,0 @@ -const _foo: string = 1; diff --git a/tests/testdata/info/065_import_map_info.out b/tests/testdata/info/065_import_map_info.out deleted file mode 100644 index 68d98f14a..000000000 --- a/tests/testdata/info/065_import_map_info.out +++ /dev/null @@ -1,6 +0,0 @@ -local: [WILDCARD]test.ts -type: TypeScript -dependencies: 7 unique -size: [WILDCARD] - -[WILDCARD] diff --git a/tests/testdata/npm/conditional_exports/main.js b/tests/testdata/npm/conditional_exports/main.js deleted file mode 100644 index 52b78bc22..000000000 --- a/tests/testdata/npm/conditional_exports/main.js +++ /dev/null @@ -1,15 +0,0 @@ -import mod from "npm:@denotest/conditional-exports"; -import foo from "npm:@denotest/conditional-exports/foo.js"; -import client from "npm:@denotest/conditional-exports/client"; -import clientFoo from "npm:@denotest/conditional-exports/client/foo"; -import clientBar from "npm:@denotest/conditional-exports/client/bar"; -import clientM from "npm:@denotest/conditional-exports/client/m"; -import supportsESM from "npm:supports-esm"; - -console.log(mod); -console.log(foo); -console.log(client); -console.log(clientFoo); -console.log(clientBar); -console.log(clientM); -console.log(supportsESM); diff --git a/tests/testdata/npm/conditional_exports/main.out b/tests/testdata/npm/conditional_exports/main.out deleted file mode 100644 index dbd1b87fe..000000000 --- a/tests/testdata/npm/conditional_exports/main.out +++ /dev/null @@ -1,19 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4545/npm/registry/@denotest/conditional-exports -Download http://localhost:4545/npm/registry/supports-esm -Download http://localhost:4545/npm/registry/has-package-exports -Download http://localhost:4545/npm/registry/@ljharb/has-package-exports-patterns -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4545/npm/registry/@denotest/conditional-exports/1.0.0.tgz -Download http://localhost:4545/npm/registry/@ljharb/has-package-exports-patterns/has-package-exports-patterns-0.0.2.tgz -Download http://localhost:4545/npm/registry/has-package-exports/has-package-exports-1.3.0.tgz -Download http://localhost:4545/npm/registry/supports-esm/supports-esm-1.0.0.tgz -[UNORDERED_END] -{ hello: "from esm" } -{ hello: "from foo" } -{ hello: "from esm client" } -{ hello: "from esm client foo" } -{ hello: "from esm client bar" } -{ hello: "from esm client m" } -true diff --git a/tests/testdata/npm/conditional_exports/main_node_modules.out b/tests/testdata/npm/conditional_exports/main_node_modules.out deleted file mode 100644 index 460aec0f1..000000000 --- a/tests/testdata/npm/conditional_exports/main_node_modules.out +++ /dev/null @@ -1,23 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4545/npm/registry/@denotest/conditional-exports -Download http://localhost:4545/npm/registry/supports-esm -Download http://localhost:4545/npm/registry/has-package-exports -Download http://localhost:4545/npm/registry/@ljharb/has-package-exports-patterns -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4545/npm/registry/@denotest/conditional-exports/1.0.0.tgz -Initialize @denotest/conditional-exports@1.0.0 -Download http://localhost:4545/npm/registry/@ljharb/has-package-exports-patterns/has-package-exports-patterns-0.0.2.tgz -Initialize @ljharb/has-package-exports-patterns@0.0.2 -Download http://localhost:4545/npm/registry/has-package-exports/has-package-exports-1.3.0.tgz -Initialize has-package-exports@1.3.0 -Download http://localhost:4545/npm/registry/supports-esm/supports-esm-1.0.0.tgz -Initialize supports-esm@1.0.0 -[UNORDERED_END] -{ hello: "from esm" } -{ hello: "from foo" } -{ hello: "from esm client" } -{ hello: "from esm client foo" } -{ hello: "from esm client bar" } -{ hello: "from esm client m" } -true diff --git a/tests/testdata/npm/esm/main.js b/tests/testdata/npm/esm/main.js deleted file mode 100644 index 0f1fa2590..000000000 --- a/tests/testdata/npm/esm/main.js +++ /dev/null @@ -1,9 +0,0 @@ -import chalk from "npm:chalk@5"; - -if (import.meta.main) { - console.log(chalk.green("chalk esm loads")); -} - -export function test(value) { - return chalk.red(value); -} diff --git a/tests/testdata/npm/esm/main.out b/tests/testdata/npm/esm/main.out deleted file mode 100644 index 2010a5b73..000000000 --- a/tests/testdata/npm/esm/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4545/npm/registry/chalk -Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz -chalk esm loads diff --git a/tests/testdata/npm/esm/test.js b/tests/testdata/npm/esm/test.js deleted file mode 100644 index b9c91c715..000000000 --- a/tests/testdata/npm/esm/test.js +++ /dev/null @@ -1,5 +0,0 @@ -import { test } from "./main.js"; - -Deno.test("test", () => { - console.log(test("test")); -}); diff --git a/tests/testdata/npm/esm/test.out b/tests/testdata/npm/esm/test.out deleted file mode 100644 index a87924424..000000000 --- a/tests/testdata/npm/esm/test.out +++ /dev/null @@ -1,11 +0,0 @@ -Download http://localhost:4545/npm/registry/chalk -Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz -running 1 test from ./npm/esm/test.js -test ... -------- output ------- -test ------ output end ----- -test ... ok ([WILDCARD]s) - -ok | 1 passed | 0 failed ([WILDCARD]s) - diff --git a/tests/testdata/run/026_redirect_javascript.js b/tests/testdata/run/026_redirect_javascript.js deleted file mode 100644 index 226a6b622..000000000 --- a/tests/testdata/run/026_redirect_javascript.js +++ /dev/null @@ -1,2 +0,0 @@ -import { value } from "http://localhost:4547/redirects/redirect3.js"; -console.log(value); diff --git a/tests/testdata/run/026_redirect_javascript.js.out b/tests/testdata/run/026_redirect_javascript.js.out deleted file mode 100644 index 290864299..000000000 --- a/tests/testdata/run/026_redirect_javascript.js.out +++ /dev/null @@ -1 +0,0 @@ -3 imports 1 diff --git a/tests/testdata/run/033_import_map.out b/tests/testdata/run/033_import_map.out deleted file mode 100644 index e9b9160e9..000000000 --- a/tests/testdata/run/033_import_map.out +++ /dev/null @@ -1,7 +0,0 @@ -Hello from remapped moment! -Hello from remapped moment dir! -Hello from remapped lodash! -Hello from remapped lodash dir! -Hello from remapped Vue! -Hello from scoped moment! -Hello from scoped! diff --git a/tests/testdata/run/033_import_map_in_config_file.out b/tests/testdata/run/033_import_map_in_config_file.out deleted file mode 100644 index 72df124a2..000000000 --- a/tests/testdata/run/033_import_map_in_config_file.out +++ /dev/null @@ -1,8 +0,0 @@ -Warning "importMap" setting is ignored when "imports" or "scopes" are specified in the config file. -Hello from remapped moment! -Hello from remapped moment dir! -Hello from remapped lodash! -Hello from remapped lodash dir! -Hello from remapped Vue! -Hello from scoped moment! -Hello from scoped! diff --git a/tests/testdata/run/033_import_map_in_flag_has_precedence.out b/tests/testdata/run/033_import_map_in_flag_has_precedence.out deleted file mode 100644 index e9b183ee6..000000000 --- a/tests/testdata/run/033_import_map_in_flag_has_precedence.out +++ /dev/null @@ -1 +0,0 @@ -error: Relative import path [WILDCARD] not prefixed with / or ./ or ../ and not in import map [WILDCARD] diff --git a/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts b/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts deleted file mode 100644 index 87684430d..000000000 --- a/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts +++ /dev/null @@ -1 +0,0 @@ -await import("unmapped"); diff --git a/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts.out b/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts.out deleted file mode 100644 index 7f35b8b4f..000000000 --- a/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -error: Uncaught (in promise) TypeError: Relative import path "unmapped" not prefixed with / or ./ or ../ and not in import map from "file://[WILDCARD]/092_import_map_unmapped_bare_specifier.ts" - at file://[WILDCARD]/092_import_map_unmapped_bare_specifier.ts:1:14 - -await import("unmapped"); -^ - at async file://[WILDCARD]/092_import_map_unmapped_bare_specifier.ts:1:1 -- cgit v1.2.3