mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
fix(node): Worker constructor doesn't check type: module of package.json (#19480)
This commit is contained in:
parent
f145cbfacc
commit
0c50c39c35
5 changed files with 31 additions and 1 deletions
3
cli/tests/unit_node/testdata/worker_module/index.js
vendored
Normal file
3
cli/tests/unit_node/testdata/worker_module/index.js
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { myFunction } from "./other_file.js";
|
||||
|
||||
myFunction().then(() => {});
|
3
cli/tests/unit_node/testdata/worker_module/other_file.js
vendored
Normal file
3
cli/tests/unit_node/testdata/worker_module/other_file.js
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
export async function myFunction() {
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
}
|
4
cli/tests/unit_node/testdata/worker_module/package.json
vendored
Normal file
4
cli/tests/unit_node/testdata/worker_module/package.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "foo",
|
||||
"type": "module"
|
||||
}
|
|
@ -133,6 +133,16 @@ Deno.test({
|
|||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "[worker_threads] worker thread with type module",
|
||||
fn() {
|
||||
const worker = new workerThreads.Worker(
|
||||
new URL("./testdata/worker_module/index.js", import.meta.url),
|
||||
);
|
||||
worker.terminate();
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "[worker_threads] inheritences",
|
||||
async fn() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue