(entry, env)
| 35 | } |
| 36 | |
| 37 | function runWithSnapshot(entry, env) { |
| 38 | const args = ['--snapshot-blob', tmpdir.resolve('snapshot.blob')]; |
| 39 | if (entry !== undefined) { |
| 40 | args.push(entry); |
| 41 | } |
| 42 | const child = spawnSync(process.execPath, args, { |
| 43 | cwd: tmpdir.path, |
| 44 | env: { |
| 45 | ...process.env, |
| 46 | ...env, |
| 47 | }, |
| 48 | }); |
| 49 | |
| 50 | const stderr = child.stderr.toString(); |
| 51 | const stdout = child.stdout.toString(); |
| 52 | console.log('[stderr]'); |
| 53 | console.log(stderr); |
| 54 | console.log('[stdout]'); |
| 55 | console.log(stdout); |
| 56 | |
| 57 | assert.strictEqual(child.status, 0); |
| 58 | |
| 59 | return { child, stderr, stdout }; |
| 60 | } |
| 61 | |
| 62 | module.exports = { |
| 63 | buildSnapshot, |
no test coverage detected
searching dependent graphs…