From f5e46c9bf2f50d66a953fa133161fc829cecff06 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Sat, 10 Feb 2024 13:22:13 -0700 Subject: chore: move cli/tests/ -> tests/ (#22369) This looks like a massive PR, but it's only a move from cli/tests -> tests, and updates of relative paths for files. This is the first step towards aggregate all of the integration test files under tests/, which will lead to a set of integration tests that can run without the CLI binary being built. While we could leave these tests under `cli`, it would require us to keep a more complex directory structure for the various test runners. In addition, we have a lot of complexity to ignore various test files in the `cli` project itself (cargo publish exclusion rules, autotests = false, etc). And finally, the `tests/` folder will eventually house the `test_ffi`, `test_napi` and other testing code, reducing the size of the root repo directory. For easier review, the extremely large and noisy "move" is in the first commit (with no changes -- just a move), while the remainder of the changes to actual files is in the second commit. --- cli/tests/testdata/import_attributes/data.json | 6 ------ cli/tests/testdata/import_attributes/dynamic_error.out | 4 ---- cli/tests/testdata/import_attributes/dynamic_error.ts | 3 --- cli/tests/testdata/import_attributes/dynamic_import.out | 3 --- cli/tests/testdata/import_attributes/dynamic_import.ts | 5 ----- cli/tests/testdata/import_attributes/json_with_shebang.json | 4 ---- cli/tests/testdata/import_attributes/json_with_shebang.ts | 3 --- .../testdata/import_attributes/json_with_shebang.ts.out | 1 - cli/tests/testdata/import_attributes/static_error.out | 3 --- cli/tests/testdata/import_attributes/static_error.ts | 3 --- cli/tests/testdata/import_attributes/static_export.out | 1 - cli/tests/testdata/import_attributes/static_export.ts | 3 --- cli/tests/testdata/import_attributes/static_import.out | 2 -- cli/tests/testdata/import_attributes/static_import.ts | 5 ----- cli/tests/testdata/import_attributes/static_reexport.ts | 1 - cli/tests/testdata/import_attributes/type_check.out | 12 ------------ cli/tests/testdata/import_attributes/type_check.ts | 5 ----- 17 files changed, 64 deletions(-) delete mode 100644 cli/tests/testdata/import_attributes/data.json delete mode 100644 cli/tests/testdata/import_attributes/dynamic_error.out delete mode 100644 cli/tests/testdata/import_attributes/dynamic_error.ts delete mode 100644 cli/tests/testdata/import_attributes/dynamic_import.out delete mode 100644 cli/tests/testdata/import_attributes/dynamic_import.ts delete mode 100644 cli/tests/testdata/import_attributes/json_with_shebang.json delete mode 100644 cli/tests/testdata/import_attributes/json_with_shebang.ts delete mode 100644 cli/tests/testdata/import_attributes/json_with_shebang.ts.out delete mode 100644 cli/tests/testdata/import_attributes/static_error.out delete mode 100644 cli/tests/testdata/import_attributes/static_error.ts delete mode 100644 cli/tests/testdata/import_attributes/static_export.out delete mode 100644 cli/tests/testdata/import_attributes/static_export.ts delete mode 100644 cli/tests/testdata/import_attributes/static_import.out delete mode 100644 cli/tests/testdata/import_attributes/static_import.ts delete mode 100644 cli/tests/testdata/import_attributes/static_reexport.ts delete mode 100644 cli/tests/testdata/import_attributes/type_check.out delete mode 100644 cli/tests/testdata/import_attributes/type_check.ts (limited to 'cli/tests/testdata/import_attributes') diff --git a/cli/tests/testdata/import_attributes/data.json b/cli/tests/testdata/import_attributes/data.json deleted file mode 100644 index 37b3ee1e0..000000000 --- a/cli/tests/testdata/import_attributes/data.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "a": "b", - "c": { - "d": 10 - } -} diff --git a/cli/tests/testdata/import_attributes/dynamic_error.out b/cli/tests/testdata/import_attributes/dynamic_error.out deleted file mode 100644 index 24f29de72..000000000 --- a/cli/tests/testdata/import_attributes/dynamic_error.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Uncaught (in promise) TypeError: Attempted to load JSON module without specifying "type": "json" attribute in the import statement. -const data = await import("./data.json"); - ^ - at async [WILDCARD]dynamic_error.ts:1:14 diff --git a/cli/tests/testdata/import_attributes/dynamic_error.ts b/cli/tests/testdata/import_attributes/dynamic_error.ts deleted file mode 100644 index 2d9c6757f..000000000 --- a/cli/tests/testdata/import_attributes/dynamic_error.ts +++ /dev/null @@ -1,3 +0,0 @@ -const data = await import("./data.json"); - -console.log(data); diff --git a/cli/tests/testdata/import_attributes/dynamic_import.out b/cli/tests/testdata/import_attributes/dynamic_import.out deleted file mode 100644 index 01bc76c8a..000000000 --- a/cli/tests/testdata/import_attributes/dynamic_import.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] -[Module: null prototype] { default: { a: "b", c: { d: 10 } } } -[Module: null prototype] { default: { a: "b", c: { d: 10 } } } diff --git a/cli/tests/testdata/import_attributes/dynamic_import.ts b/cli/tests/testdata/import_attributes/dynamic_import.ts deleted file mode 100644 index 73f348697..000000000 --- a/cli/tests/testdata/import_attributes/dynamic_import.ts +++ /dev/null @@ -1,5 +0,0 @@ -const data1 = await import("./data.json", { with: { type: "json" } }); -const data2 = await import("./data.json", { assert: { type: "json" } }); - -console.log(data1); -console.log(data2); diff --git a/cli/tests/testdata/import_attributes/json_with_shebang.json b/cli/tests/testdata/import_attributes/json_with_shebang.json deleted file mode 100644 index b695e4457..000000000 --- a/cli/tests/testdata/import_attributes/json_with_shebang.json +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/env -S deno run -{ - "test": null -} diff --git a/cli/tests/testdata/import_attributes/json_with_shebang.ts b/cli/tests/testdata/import_attributes/json_with_shebang.ts deleted file mode 100644 index 523bf8772..000000000 --- a/cli/tests/testdata/import_attributes/json_with_shebang.ts +++ /dev/null @@ -1,3 +0,0 @@ -import json from "./json_with_shebang.json" assert { type: "json" }; - -console.log(json); diff --git a/cli/tests/testdata/import_attributes/json_with_shebang.ts.out b/cli/tests/testdata/import_attributes/json_with_shebang.ts.out deleted file mode 100644 index 23eb03720..000000000 --- a/cli/tests/testdata/import_attributes/json_with_shebang.ts.out +++ /dev/null @@ -1 +0,0 @@ -error: Uncaught SyntaxError: Unexpected token '#', "#!/usr/env"... is not valid JSON diff --git a/cli/tests/testdata/import_attributes/static_error.out b/cli/tests/testdata/import_attributes/static_error.out deleted file mode 100644 index 29b24b965..000000000 --- a/cli/tests/testdata/import_attributes/static_error.out +++ /dev/null @@ -1,3 +0,0 @@ -error: Expected a JavaScript or TypeScript module, but identified a Json module. Consider importing Json modules with an import attribute with the type of "json". - Specifier: [WILDCARD]/data.json - at [WILDCARD]static_error.ts:1:18 diff --git a/cli/tests/testdata/import_attributes/static_error.ts b/cli/tests/testdata/import_attributes/static_error.ts deleted file mode 100644 index 0bc3a93f8..000000000 --- a/cli/tests/testdata/import_attributes/static_error.ts +++ /dev/null @@ -1,3 +0,0 @@ -import data from "./data.json"; - -console.log(data); diff --git a/cli/tests/testdata/import_attributes/static_export.out b/cli/tests/testdata/import_attributes/static_export.out deleted file mode 100644 index 41af79d7c..000000000 --- a/cli/tests/testdata/import_attributes/static_export.out +++ /dev/null @@ -1 +0,0 @@ -{ a: "b", c: { d: 10 } } diff --git a/cli/tests/testdata/import_attributes/static_export.ts b/cli/tests/testdata/import_attributes/static_export.ts deleted file mode 100644 index ac3ee694f..000000000 --- a/cli/tests/testdata/import_attributes/static_export.ts +++ /dev/null @@ -1,3 +0,0 @@ -import data from "./static_reexport.ts"; - -console.log(data); diff --git a/cli/tests/testdata/import_attributes/static_import.out b/cli/tests/testdata/import_attributes/static_import.out deleted file mode 100644 index e57dffa99..000000000 --- a/cli/tests/testdata/import_attributes/static_import.out +++ /dev/null @@ -1,2 +0,0 @@ -{ a: "b", c: { d: 10 } } -{ a: "b", c: { d: 10 } } diff --git a/cli/tests/testdata/import_attributes/static_import.ts b/cli/tests/testdata/import_attributes/static_import.ts deleted file mode 100644 index d46d93b4a..000000000 --- a/cli/tests/testdata/import_attributes/static_import.ts +++ /dev/null @@ -1,5 +0,0 @@ -import data1 from "./data.json" with { type: "json" }; -import data2 from "./data.json" assert { type: "json" }; - -console.log(data1); -console.log(data2); diff --git a/cli/tests/testdata/import_attributes/static_reexport.ts b/cli/tests/testdata/import_attributes/static_reexport.ts deleted file mode 100644 index 81af428be..000000000 --- a/cli/tests/testdata/import_attributes/static_reexport.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./data.json" assert { type: "json" }; diff --git a/cli/tests/testdata/import_attributes/type_check.out b/cli/tests/testdata/import_attributes/type_check.out deleted file mode 100644 index 5ecdec82d..000000000 --- a/cli/tests/testdata/import_attributes/type_check.out +++ /dev/null @@ -1,12 +0,0 @@ -Check file:///[WILDCARD]/type_check.ts -error: TS2339 [ERROR]: Property 'foo' does not exist on type '{ a: string; c: { d: number; }; }'. -console.log(data1.foo); - ~~~ - at [WILDCARD]type_check.ts:4:19 - -TS2339 [ERROR]: Property 'foo' does not exist on type '{ a: string; c: { d: number; }; }'. -console.log(data2.foo); - ~~~ - at [WILDCARD]type_check.ts:5:19 - -Found 2 errors. diff --git a/cli/tests/testdata/import_attributes/type_check.ts b/cli/tests/testdata/import_attributes/type_check.ts deleted file mode 100644 index ddf28e67a..000000000 --- a/cli/tests/testdata/import_attributes/type_check.ts +++ /dev/null @@ -1,5 +0,0 @@ -import data1 from "./data.json" with { type: "json" }; -import data2 from "./data.json" assert { type: "json" }; - -console.log(data1.foo); -console.log(data2.foo); -- cgit v1.2.3