Files
bun.sh/test/cli/hot/hot-runner.js
2024-03-12 05:38:59 -07:00

10 lines
430 B
JavaScript

import "./hot-runner-imported";
globalThis.counter ??= 0;
// Because console.log on windows is asynchronous, it can happen that we reload on
// an incomplete write. This fails our tests even though the behavior is correct.
// To fix this we use console.write, which (apparently) performs the write in a single chunk.
console.write(`[${Date.now()}] [#!root] Reloaded: ${++globalThis.counter}\n`);
!setTimeout(() => {}, 9999999);