MCPcopy Index your code
hub / github.com/mozilla/web-ext / assertOnChange

Function assertOnChange

tests/unit/test.watcher.js:216–225  ·  view source on GitHub ↗
(filePath, expectedCallCount)

Source from the content-addressed store, hash-verified

214 }
215
216 async function assertOnChange(filePath, expectedCallCount) {
217 const promiseOnChanged = new Promise((resolve) =>
218 watchAll.once('change', (f) => resolve(f)),
219 );
220 await waitDebounce();
221 await fs.writeFile(filePath, '<content>');
222 assert.equal(filePath, await promiseOnChanged);
223 await waitDebounce();
224 sinon.assert.callCount(onChange, expectedCallCount);
225 }
226
227 // Verify foo.txt is being ignored.
228 await assertOnChange(files[0], 0);

Callers 1

test.watcher.jsFile · 0.85

Calls 1

waitDebounceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…