(additionalArguments = [], additionalEnv = {})
| 12 | const blobPath = tmpdir.resolve('snapshot.blob'); |
| 13 | |
| 14 | function 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 | |
| 43 | test(); |
| 44 | test([], { TEST_IN_SERIALIZER: 1 }); |
no test coverage detected
searching dependent graphs…