MCPcopy Index your code
hub / github.com/remoteinterview/zero / writeFile

Function writeFile

test/integration/hmr.js:11–20  ·  view source on GitHub ↗
(file, data)

Source from the content-addressed store, hash-verified

9}
10
11function writeFile(file, data) {
12 fs.writeFileSync(makePath(file), data, "utf8");
13 return new Promise((resolve, reject) => {
14 // wait a bit for zero to be ready
15 // TODO: When zero has an eventemitter feature, wait for 'ready' instead.
16 setTimeout(() => {
17 resolve();
18 }, process.env.HMRWAITTIME || 3000);
19 });
20}
21
22test("JS HMR (add a new handler and modify it)", async () => {
23 expect.assertions(2);

Callers 1

hmr.jsFile · 0.85

Calls 2

makePathFunction · 0.85
resolveFunction · 0.85

Tested by

no test coverage detected