diff options
author | Luca Casonato <hello@lcas.dev> | 2024-07-31 16:28:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-31 16:28:08 +0200 |
commit | 1faac2dce380afa387f08780ae1a79d087b3acf0 (patch) | |
tree | c1a47a7a3f6306e0387a41edff627f22438cd19e /tests/specs | |
parent | f6fad68d7b26f2b58a31b96860dba2bbfcfd1e61 (diff) |
fix(ext/node): handle node child_process with --v8-options flag (#24804)
Makes `v8flags` package from NPM work.
Diffstat (limited to 'tests/specs')
-rw-r--r-- | tests/specs/run/npm_v8flags/__test__.jsonc | 5 | ||||
-rw-r--r-- | tests/specs/run/npm_v8flags/main.js | 17 | ||||
-rw-r--r-- | tests/specs/run/npm_v8flags/main.out | 3 |
3 files changed, 25 insertions, 0 deletions
diff --git a/tests/specs/run/npm_v8flags/__test__.jsonc b/tests/specs/run/npm_v8flags/__test__.jsonc new file mode 100644 index 000000000..88d13e769 --- /dev/null +++ b/tests/specs/run/npm_v8flags/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run -A main.js", + "output": "main.out", + "exitCode": 0 +} diff --git a/tests/specs/run/npm_v8flags/main.js b/tests/specs/run/npm_v8flags/main.js new file mode 100644 index 000000000..5c870d221 --- /dev/null +++ b/tests/specs/run/npm_v8flags/main.js @@ -0,0 +1,17 @@ +import v8flags from "npm:v8flags@4.0.1"; + +const flags = await new Promise((resolve, reject) => { + v8flags((err, flags) => { + if (err) { + reject(err); + } else { + resolve(flags); + } + }); +}); + +if (flags.length < 100) { + throw new Error("Expected at least 100 flags"); +} + +console.log("ok"); diff --git a/tests/specs/run/npm_v8flags/main.out b/tests/specs/run/npm_v8flags/main.out new file mode 100644 index 000000000..56c61f0ea --- /dev/null +++ b/tests/specs/run/npm_v8flags/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/v8flags +Download http://localhost:4260/v8flags/v8flags-4.0.1.tgz +ok |