From 0c50c39c35f1c92bbb96bc3e101e2c446256cb7b Mon Sep 17 00:00:00 2001 From: Vedant Pandey Date: Thu, 15 Jun 2023 20:30:30 +0530 Subject: fix(node): Worker constructor doesn't check type: module of package.json (#19480) --- cli/tests/unit_node/testdata/worker_module/index.js | 3 +++ cli/tests/unit_node/testdata/worker_module/other_file.js | 3 +++ cli/tests/unit_node/testdata/worker_module/package.json | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 cli/tests/unit_node/testdata/worker_module/index.js create mode 100644 cli/tests/unit_node/testdata/worker_module/other_file.js create mode 100644 cli/tests/unit_node/testdata/worker_module/package.json (limited to 'cli/tests/unit_node/testdata') diff --git a/cli/tests/unit_node/testdata/worker_module/index.js b/cli/tests/unit_node/testdata/worker_module/index.js new file mode 100644 index 000000000..a3e976b65 --- /dev/null +++ b/cli/tests/unit_node/testdata/worker_module/index.js @@ -0,0 +1,3 @@ +import { myFunction } from "./other_file.js"; + +myFunction().then(() => {}); diff --git a/cli/tests/unit_node/testdata/worker_module/other_file.js b/cli/tests/unit_node/testdata/worker_module/other_file.js new file mode 100644 index 000000000..41789dfe8 --- /dev/null +++ b/cli/tests/unit_node/testdata/worker_module/other_file.js @@ -0,0 +1,3 @@ +export async function myFunction() { + await new Promise((resolve) => setTimeout(resolve, 100)); +} diff --git a/cli/tests/unit_node/testdata/worker_module/package.json b/cli/tests/unit_node/testdata/worker_module/package.json new file mode 100644 index 000000000..486d2f82b --- /dev/null +++ b/cli/tests/unit_node/testdata/worker_module/package.json @@ -0,0 +1,4 @@ +{ + "name": "foo", + "type": "module" +} -- cgit v1.2.3