From ae6a2b23bae83795bd973414216a89c839dd8fda Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 14 Oct 2024 23:57:31 -0400 Subject: fix: do not panic running remote cjs module (#26259) Instead error. --- tests/specs/run/remote_cjs_main/__test__.jsonc | 5 +++++ tests/specs/run/remote_cjs_main/output.out | 3 +++ tests/testdata/run/add.cjs | 3 +++ 3 files changed, 11 insertions(+) create mode 100644 tests/specs/run/remote_cjs_main/__test__.jsonc create mode 100644 tests/specs/run/remote_cjs_main/output.out create mode 100644 tests/testdata/run/add.cjs (limited to 'tests') diff --git a/tests/specs/run/remote_cjs_main/__test__.jsonc b/tests/specs/run/remote_cjs_main/__test__.jsonc new file mode 100644 index 000000000..f45d09406 --- /dev/null +++ b/tests/specs/run/remote_cjs_main/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run http://localhost:4545/run/add.cjs", + "output": "output.out", + "exitCode": 1 +} diff --git a/tests/specs/run/remote_cjs_main/output.out b/tests/specs/run/remote_cjs_main/output.out new file mode 100644 index 000000000..f75c33907 --- /dev/null +++ b/tests/specs/run/remote_cjs_main/output.out @@ -0,0 +1,3 @@ +Download http://localhost:4545/run/add.cjs +error: Expected a JavaScript or TypeScript module, but identified a Cjs module. Importing these types of modules is currently not supported. + Specifier: http://localhost:4545/run/add.cjs diff --git a/tests/testdata/run/add.cjs b/tests/testdata/run/add.cjs new file mode 100644 index 000000000..2a886fbc1 --- /dev/null +++ b/tests/testdata/run/add.cjs @@ -0,0 +1,3 @@ +module.exports.add = function (a, b) { + return a + b; +}; -- cgit v1.2.3