MCPcopy Index your code
hub / github.com/nodejs/node / test

Function test

test/parallel/test-snapshot-stack-trace-limit-mutation.js:14–41  ·  view source on GitHub ↗
(additionalArguments = [], additionalEnv = {})

Source from the content-addressed store, hash-verified

12const blobPath = tmpdir.resolve('snapshot.blob');
13
14function test(additionalArguments = [], additionalEnv = {}) {
15 tmpdir.refresh();
16 // Check the mutation works without --stack-trace-limit.
17 spawnSyncAndAssert(process.execPath, [
18 ...additionalArguments,
19 '--snapshot-blob',
20 blobPath,
21 '--build-snapshot',
22 fixtures.path('snapshot', 'mutate-error-stack-trace-limit.js'),
23 ], {
24 cwd: tmpdir.path,
25 env: {
26 ...process.env,
27 ...additionalEnv,
28 }
29 }, {
30 stderr(output) {
31 assert.match(output, /Error\.stackTraceLimit has been modified by the snapshot builder script/);
32 assert.match(output, /It will be preserved after snapshot deserialization/);
33 }
34 });
35 spawnSyncAndExitWithoutError(process.execPath, [
36 '--snapshot-blob',
37 blobPath,
38 ], {
39 cwd: tmpdir.path
40 });
41}
42
43test();
44test([], { TEST_IN_SERIALIZER: 1 });

Calls 4

spawnSyncAndAssertFunction · 0.85
refreshMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…