diff options
| author | Matt Mastracci <matthew@mastracci.com> | 2024-02-10 13:22:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-10 20:22:13 +0000 |
| commit | f5e46c9bf2f50d66a953fa133161fc829cecff06 (patch) | |
| tree | 8faf2f5831c1c7b11d842cd9908d141082c869a5 /tests/testdata/import_maps | |
| parent | d2477f780630a812bfd65e3987b70c0d309385bb (diff) | |
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.
Diffstat (limited to 'tests/testdata/import_maps')
| -rw-r--r-- | tests/testdata/import_maps/config.json | 15 | ||||
| -rw-r--r-- | tests/testdata/import_maps/import_map.json | 15 | ||||
| -rw-r--r-- | tests/testdata/import_maps/import_map_invalid.json | 7 | ||||
| -rw-r--r-- | tests/testdata/import_maps/import_map_remote.json | 9 | ||||
| -rw-r--r-- | tests/testdata/import_maps/lodash/lodash.ts | 1 | ||||
| -rw-r--r-- | tests/testdata/import_maps/lodash/other_file.ts | 1 | ||||
| -rw-r--r-- | tests/testdata/import_maps/moment/moment.ts | 1 | ||||
| -rw-r--r-- | tests/testdata/import_maps/moment/other_file.ts | 1 | ||||
| -rw-r--r-- | tests/testdata/import_maps/print_hello.ts | 3 | ||||
| -rw-r--r-- | tests/testdata/import_maps/scope/scoped.ts | 2 | ||||
| -rw-r--r-- | tests/testdata/import_maps/scoped_moment.ts | 1 | ||||
| -rw-r--r-- | tests/testdata/import_maps/test.ts | 6 | ||||
| -rw-r--r-- | tests/testdata/import_maps/test_remote.ts | 5 | ||||
| -rw-r--r-- | tests/testdata/import_maps/vue.ts | 1 |
14 files changed, 68 insertions, 0 deletions
diff --git a/tests/testdata/import_maps/config.json b/tests/testdata/import_maps/config.json new file mode 100644 index 000000000..b296a63c7 --- /dev/null +++ b/tests/testdata/import_maps/config.json @@ -0,0 +1,15 @@ +{ + "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 new file mode 100644 index 000000000..40d1d4ec2 --- /dev/null +++ b/tests/testdata/import_maps/import_map.json @@ -0,0 +1,15 @@ +{ + "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 new file mode 100644 index 000000000..a09d280c5 --- /dev/null +++ b/tests/testdata/import_maps/import_map_invalid.json @@ -0,0 +1,7 @@ +{ + "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 new file mode 100644 index 000000000..51f90f69c --- /dev/null +++ b/tests/testdata/import_maps/import_map_remote.json @@ -0,0 +1,9 @@ +{ + "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" + } +} diff --git a/tests/testdata/import_maps/lodash/lodash.ts b/tests/testdata/import_maps/lodash/lodash.ts new file mode 100644 index 000000000..2ec04ed3c --- /dev/null +++ b/tests/testdata/import_maps/lodash/lodash.ts @@ -0,0 +1 @@ +console.log("Hello from remapped lodash!"); diff --git a/tests/testdata/import_maps/lodash/other_file.ts b/tests/testdata/import_maps/lodash/other_file.ts new file mode 100644 index 000000000..714adae3f --- /dev/null +++ b/tests/testdata/import_maps/lodash/other_file.ts @@ -0,0 +1 @@ +console.log("Hello from remapped lodash dir!"); diff --git a/tests/testdata/import_maps/moment/moment.ts b/tests/testdata/import_maps/moment/moment.ts new file mode 100644 index 000000000..2b54a431e --- /dev/null +++ b/tests/testdata/import_maps/moment/moment.ts @@ -0,0 +1 @@ +console.log("Hello from remapped moment!"); diff --git a/tests/testdata/import_maps/moment/other_file.ts b/tests/testdata/import_maps/moment/other_file.ts new file mode 100644 index 000000000..24f3a0226 --- /dev/null +++ b/tests/testdata/import_maps/moment/other_file.ts @@ -0,0 +1 @@ +console.log("Hello from remapped moment dir!"); diff --git a/tests/testdata/import_maps/print_hello.ts b/tests/testdata/import_maps/print_hello.ts new file mode 100644 index 000000000..794257390 --- /dev/null +++ b/tests/testdata/import_maps/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello, world!"); +} diff --git a/tests/testdata/import_maps/scope/scoped.ts b/tests/testdata/import_maps/scope/scoped.ts new file mode 100644 index 000000000..9a0b5d8e3 --- /dev/null +++ b/tests/testdata/import_maps/scope/scoped.ts @@ -0,0 +1,2 @@ +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 new file mode 100644 index 000000000..9f67f88d4 --- /dev/null +++ b/tests/testdata/import_maps/scoped_moment.ts @@ -0,0 +1 @@ +console.log("Hello from scoped moment!"); diff --git a/tests/testdata/import_maps/test.ts b/tests/testdata/import_maps/test.ts new file mode 100644 index 000000000..9b09e9953 --- /dev/null +++ b/tests/testdata/import_maps/test.ts @@ -0,0 +1,6 @@ +import "moment"; +import "moment/other_file.ts"; +import "lodash"; +import "lodash/other_file.ts"; +import "https://www.unpkg.com/vue/dist/vue.runtime.esm.js"; +import "./scope/scoped.ts"; diff --git a/tests/testdata/import_maps/test_remote.ts b/tests/testdata/import_maps/test_remote.ts new file mode 100644 index 000000000..206bdbd5f --- /dev/null +++ b/tests/testdata/import_maps/test_remote.ts @@ -0,0 +1,5 @@ +import "moment"; +import "moment/other_file.ts"; +import "lodash"; +import "lodash/other_file.ts"; +import "https://www.unpkg.com/vue/dist/vue.runtime.esm.js"; diff --git a/tests/testdata/import_maps/vue.ts b/tests/testdata/import_maps/vue.ts new file mode 100644 index 000000000..76dbe1917 --- /dev/null +++ b/tests/testdata/import_maps/vue.ts @@ -0,0 +1 @@ +console.log("Hello from remapped Vue!"); |
