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

Function runWithSnapshot

test/common/snapshot.js:37–60  ·  view source on GitHub ↗
(entry, env)

Source from the content-addressed store, hash-verified

35}
36
37function 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
62module.exports = {
63 buildSnapshot,

Calls 5

spawnSyncFunction · 0.50
resolveMethod · 0.45
pushMethod · 0.45
toStringMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…