summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/specs/node/cjs_analysis_multiple_errors/__test__.jsonc5
-rw-r--r--tests/specs/node/cjs_analysis_multiple_errors/deno.json5
-rw-r--r--tests/specs/node/cjs_analysis_multiple_errors/main.out3
-rw-r--r--tests/specs/node/cjs_analysis_multiple_errors/main.ts2
-rw-r--r--tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/a.js4
-rw-r--r--tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/b.js4
-rw-r--r--tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/index.js8
-rw-r--r--tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/package.json3
-rw-r--r--tests/specs/node/cjs_analysis_multiple_errors/package.json0
9 files changed, 34 insertions, 0 deletions
diff --git a/tests/specs/node/cjs_analysis_multiple_errors/__test__.jsonc b/tests/specs/node/cjs_analysis_multiple_errors/__test__.jsonc
new file mode 100644
index 000000000..7b5c5e1b6
--- /dev/null
+++ b/tests/specs/node/cjs_analysis_multiple_errors/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "run main.ts",
+ "output": "main.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/node/cjs_analysis_multiple_errors/deno.json b/tests/specs/node/cjs_analysis_multiple_errors/deno.json
new file mode 100644
index 000000000..f6eb03cc9
--- /dev/null
+++ b/tests/specs/node/cjs_analysis_multiple_errors/deno.json
@@ -0,0 +1,5 @@
+{
+ "unstable": [
+ "byonm"
+ ]
+}
diff --git a/tests/specs/node/cjs_analysis_multiple_errors/main.out b/tests/specs/node/cjs_analysis_multiple_errors/main.out
new file mode 100644
index 000000000..cc8077950
--- /dev/null
+++ b/tests/specs/node/cjs_analysis_multiple_errors/main.out
@@ -0,0 +1,3 @@
+[# Since this package has multiple cjs export errors and the resolution is done in ]
+[# parallel, we want to ensure the output is deterministic when there's multiple errors]
+error: [ERR_MODULE_NOT_FOUND] Cannot find module "[WILDLINE]not_exists.js" imported from "[WILDLINE]a.js"
diff --git a/tests/specs/node/cjs_analysis_multiple_errors/main.ts b/tests/specs/node/cjs_analysis_multiple_errors/main.ts
new file mode 100644
index 000000000..73b61f674
--- /dev/null
+++ b/tests/specs/node/cjs_analysis_multiple_errors/main.ts
@@ -0,0 +1,2 @@
+import * as pkg from "package";
+console.log(pkg);
diff --git a/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/a.js b/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/a.js
new file mode 100644
index 000000000..151cd81d7
--- /dev/null
+++ b/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/a.js
@@ -0,0 +1,4 @@
+var external001 = require("./not_exists.js");
+Object.keys(external001).forEach(function(key) {
+ exports[key] = external001[key];
+});
diff --git a/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/b.js b/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/b.js
new file mode 100644
index 000000000..afd9d5cdb
--- /dev/null
+++ b/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/b.js
@@ -0,0 +1,4 @@
+var external001 = require("./not_exists2.js");
+Object.keys(external001).forEach(function(key) {
+ exports[key] = external001[key];
+});
diff --git a/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/index.js b/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/index.js
new file mode 100644
index 000000000..60be5e81c
--- /dev/null
+++ b/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/index.js
@@ -0,0 +1,8 @@
+var external001 = require("./a.js");
+Object.keys(external001).forEach(function(key) {
+ exports[key] = external001[key];
+});
+var external002 = require("./b.js");
+Object.keys(external002).forEach(function(key) {
+ exports[key] = external002[key];
+}); \ No newline at end of file
diff --git a/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/package.json b/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/package.json
new file mode 100644
index 000000000..920dda080
--- /dev/null
+++ b/tests/specs/node/cjs_analysis_multiple_errors/node_modules/package/package.json
@@ -0,0 +1,3 @@
+{
+ "name": "package"
+}
diff --git a/tests/specs/node/cjs_analysis_multiple_errors/package.json b/tests/specs/node/cjs_analysis_multiple_errors/package.json
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/specs/node/cjs_analysis_multiple_errors/package.json