diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-09-27 12:35:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-27 12:35:37 -0700 |
commit | fbddd5a2ebfb11dd376a751e9fc4cf09a6286ada (patch) | |
tree | 75c13ee9f26f61fe8c1d6f80df2580a523177c1b /tests | |
parent | a8d1ab52761516b7f9b6069d6e433254794ed48c (diff) |
fix(node): Pass NPM_PROCESS_STATE to subprocesses via temp file instead of env var (#25896)
Fixes https://github.com/denoland/deno/issues/25401. Fixes
https://github.com/denoland/deno/issues/25841. Fixes
https://github.com/denoland/deno/issues/25891.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/registry/npm/@denotest/child-process-fork/1.0.0/index.js | 11 | ||||
-rw-r--r-- | tests/unit/ops_test.ts | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/tests/registry/npm/@denotest/child-process-fork/1.0.0/index.js b/tests/registry/npm/@denotest/child-process-fork/1.0.0/index.js index 0482be404..ca0ba246a 100644 --- a/tests/registry/npm/@denotest/child-process-fork/1.0.0/index.js +++ b/tests/registry/npm/@denotest/child-process-fork/1.0.0/index.js @@ -1,14 +1,9 @@ const path = require("path"); +const childProcess = require("node:child_process"); function childProcessFork(path) { - const command = new Deno.Command(Deno.execPath(), { - args: ["run", "-A", path], - env: { - "DENO_DONT_USE_INTERNAL_NODE_COMPAT_STATE": Deno[Deno.internal].core.ops.op_npm_process_state(), - } - }); - const child = command.spawn(); - child.status.then(() => { + const child = childProcess.fork(path); + child.on("exit", () => { console.log("Done."); }); } diff --git a/tests/unit/ops_test.ts b/tests/unit/ops_test.ts index 6de55f8b6..4ba7c5ce3 100644 --- a/tests/unit/ops_test.ts +++ b/tests/unit/ops_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -const EXPECTED_OP_COUNT = 12; +const EXPECTED_OP_COUNT = 11; Deno.test(function checkExposedOps() { // @ts-ignore TS doesn't allow to index with symbol |