summaryrefslogtreecommitdiff
path: root/cli/tests/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r--cli/tests/testdata/compat/import_cjs_from_esm.out1
-rw-r--r--cli/tests/testdata/compat/import_cjs_from_esm/imported.js9
-rw-r--r--cli/tests/testdata/compat/import_cjs_from_esm/main.mjs1
-rw-r--r--cli/tests/testdata/compat/import_cjs_from_esm/reexports.js1
-rw-r--r--cli/tests/testdata/compat/import_cjs_from_esm/reexports2.js2
5 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/testdata/compat/import_cjs_from_esm.out b/cli/tests/testdata/compat/import_cjs_from_esm.out
new file mode 100644
index 000000000..ffaa5e406
--- /dev/null
+++ b/cli/tests/testdata/compat/import_cjs_from_esm.out
@@ -0,0 +1 @@
+{ a: "A", b: "B", foo: "foo", bar: "bar", fizz: { buzz: "buzz", fizz: "FIZZ" } }
diff --git a/cli/tests/testdata/compat/import_cjs_from_esm/imported.js b/cli/tests/testdata/compat/import_cjs_from_esm/imported.js
new file mode 100644
index 000000000..49ab4c782
--- /dev/null
+++ b/cli/tests/testdata/compat/import_cjs_from_esm/imported.js
@@ -0,0 +1,9 @@
+exports = {
+ a: "A",
+ b: "B",
+};
+exports.foo = "foo";
+exports.bar = "bar";
+exports.fizz = require("./reexports.js");
+
+console.log(exports);
diff --git a/cli/tests/testdata/compat/import_cjs_from_esm/main.mjs b/cli/tests/testdata/compat/import_cjs_from_esm/main.mjs
new file mode 100644
index 000000000..6fbed1b7c
--- /dev/null
+++ b/cli/tests/testdata/compat/import_cjs_from_esm/main.mjs
@@ -0,0 +1 @@
+import "./imported.js";
diff --git a/cli/tests/testdata/compat/import_cjs_from_esm/reexports.js b/cli/tests/testdata/compat/import_cjs_from_esm/reexports.js
new file mode 100644
index 000000000..62edb7708
--- /dev/null
+++ b/cli/tests/testdata/compat/import_cjs_from_esm/reexports.js
@@ -0,0 +1 @@
+module.exports = require("./reexports2.js");
diff --git a/cli/tests/testdata/compat/import_cjs_from_esm/reexports2.js b/cli/tests/testdata/compat/import_cjs_from_esm/reexports2.js
new file mode 100644
index 000000000..183d833b0
--- /dev/null
+++ b/cli/tests/testdata/compat/import_cjs_from_esm/reexports2.js
@@ -0,0 +1,2 @@
+exports.buzz = "buzz";
+exports.fizz = "FIZZ";