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

Function refresh

test/common/tmpdir.js:45–57  ·  view source on GitHub ↗
(useSpawn = false)

Source from the content-addressed store, hash-verified

43
44let firstRefresh = true;
45function refresh(useSpawn = false) {
46 rmSync(tmpPath, useSpawn);
47 fs.mkdirSync(tmpPath);
48
49 if (firstRefresh) {
50 firstRefresh = false;
51 // Clean only when a test uses refresh. This allows for child processes to
52 // use the tmpdir and only the parent will clean on exit.
53 process.on('exit', () => {
54 return onexit(useSpawn);
55 });
56 }
57}
58
59function onexit(useSpawn) {
60 // Change directory to avoid possible EBUSY

Callers

nothing calls this directly

Calls 4

rmSyncFunction · 0.70
onexitFunction · 0.70
mkdirSyncMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…