summaryrefslogtreecommitdiff
path: root/tests/testdata/vendor
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-02-10 13:22:13 -0700
committerGitHub <noreply@github.com>2024-02-10 20:22:13 +0000
commitf5e46c9bf2f50d66a953fa133161fc829cecff06 (patch)
tree8faf2f5831c1c7b11d842cd9908d141082c869a5 /tests/testdata/vendor
parentd2477f780630a812bfd65e3987b70c0d309385bb (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/vendor')
-rw-r--r--tests/testdata/vendor/dynamic.ts3
-rw-r--r--tests/testdata/vendor/dynamic_non_analyzable.ts4
-rw-r--r--tests/testdata/vendor/dynamic_non_existent.ts11
-rw-r--r--tests/testdata/vendor/dynamic_non_existent.ts.out7
-rw-r--r--tests/testdata/vendor/logger.ts5
-rw-r--r--tests/testdata/vendor/mod.ts1
-rw-r--r--tests/testdata/vendor/npm_and_node_specifier.ts2
-rw-r--r--tests/testdata/vendor/query_reexport.ts1
8 files changed, 34 insertions, 0 deletions
diff --git a/tests/testdata/vendor/dynamic.ts b/tests/testdata/vendor/dynamic.ts
new file mode 100644
index 000000000..e2cbb0e59
--- /dev/null
+++ b/tests/testdata/vendor/dynamic.ts
@@ -0,0 +1,3 @@
+const { Logger } = await import("./logger.ts");
+
+export { Logger };
diff --git a/tests/testdata/vendor/dynamic_non_analyzable.ts b/tests/testdata/vendor/dynamic_non_analyzable.ts
new file mode 100644
index 000000000..1847939f6
--- /dev/null
+++ b/tests/testdata/vendor/dynamic_non_analyzable.ts
@@ -0,0 +1,4 @@
+const value = (() => "./logger.ts")();
+const { Logger } = await import(value);
+
+export { Logger };
diff --git a/tests/testdata/vendor/dynamic_non_existent.ts b/tests/testdata/vendor/dynamic_non_existent.ts
new file mode 100644
index 000000000..a48e2accb
--- /dev/null
+++ b/tests/testdata/vendor/dynamic_non_existent.ts
@@ -0,0 +1,11 @@
+// this should still vendor
+// deno-lint-ignore no-constant-condition
+if (false) {
+ await import("./non-existent.js");
+}
+
+export class Logger {
+ log(text: string) {
+ console.log(text);
+ }
+}
diff --git a/tests/testdata/vendor/dynamic_non_existent.ts.out b/tests/testdata/vendor/dynamic_non_existent.ts.out
new file mode 100644
index 000000000..a1b2ade81
--- /dev/null
+++ b/tests/testdata/vendor/dynamic_non_existent.ts.out
@@ -0,0 +1,7 @@
+Download http://localhost:4545/vendor/dynamic_non_existent.ts
+Download http://localhost:4545/vendor/non-existent.js
+Ignoring: Dynamic import not found "http://localhost:4545/vendor/non-existent.js".
+ at http://localhost:4545/vendor/dynamic_non_existent.ts:4:16
+Vendored 1 module into vendor/ directory.
+
+To use vendored modules, specify the `--import-map vendor/import_map.json` flag when invoking Deno subcommands or add an `"importMap": "<path_to_vendored_import_map>"` entry to a deno.json file.
diff --git a/tests/testdata/vendor/logger.ts b/tests/testdata/vendor/logger.ts
new file mode 100644
index 000000000..97f603a48
--- /dev/null
+++ b/tests/testdata/vendor/logger.ts
@@ -0,0 +1,5 @@
+export class Logger {
+ log(text: string) {
+ console.log(text);
+ }
+}
diff --git a/tests/testdata/vendor/mod.ts b/tests/testdata/vendor/mod.ts
new file mode 100644
index 000000000..8824d1b2a
--- /dev/null
+++ b/tests/testdata/vendor/mod.ts
@@ -0,0 +1 @@
+export * from "./logger.ts";
diff --git a/tests/testdata/vendor/npm_and_node_specifier.ts b/tests/testdata/vendor/npm_and_node_specifier.ts
new file mode 100644
index 000000000..61962e836
--- /dev/null
+++ b/tests/testdata/vendor/npm_and_node_specifier.ts
@@ -0,0 +1,2 @@
+export { default as path } from "node:path";
+export { getValue, setValue } from "npm:@denotest/esm-basic";
diff --git a/tests/testdata/vendor/query_reexport.ts b/tests/testdata/vendor/query_reexport.ts
new file mode 100644
index 000000000..5dfafb532
--- /dev/null
+++ b/tests/testdata/vendor/query_reexport.ts
@@ -0,0 +1 @@
+export * from "./logger.ts?test";