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

Function testRename

test/common/watch.js:138–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136 };
137
138 const testRename = async () => {
139 await ran1.promise;
140 runs.push(currentRun);
141 currentRun = '';
142 const fileToRenamePath = tmpdir.resolve(fileToUpdate);
143 const newFileNamePath = tmpdir.resolve(`test-renamed-${fileToUpdate}`);
144
145 await performFileOperation(
146 () => renameSync(fileToRenamePath, newFileNamePath),
147 useRunApi,
148 );
149 await ran2.promise;
150
151 runs.push(currentRun);
152 child.kill();
153 await once(child, 'exit');
154
155 assert.strictEqual(runs.length, 2);
156
157 const [firstRun, secondRun] = runs;
158 assertTestOutput(firstRun, useRunApi);
159
160 if (action === 'rename2') {
161 assert.match(secondRun, /MODULE_NOT_FOUND/);
162 return;
163 }
164
165 assertTestOutput(secondRun, useRunApi);
166 };
167
168 const testDelete = async () => {
169 await ran1.promise;

Callers 1

testRunnerWatchFunction · 0.85

Calls 8

performFileOperationFunction · 0.85
assertTestOutputFunction · 0.85
killMethod · 0.80
matchMethod · 0.65
renameSyncFunction · 0.50
onceFunction · 0.50
pushMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…