Skip to content

Commit

Permalink
test: clear check timer to avoid hangs
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Sep 11, 2024
1 parent 8feeb0a commit 0856113
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ const chokidar_watch = (path = currentDir, opts) => {
const waitFor = (spies) => {
if (spies.length === 0) throw new TypeError('SPies zero');
return new Promise((resolve, reject) => {
let checkTimer;
const timeout = setTimeout(() => {
clearTimeout(checkTimer);
reject(new Error('timeout'));
}, TEST_TIMEOUT);
let checkTimer;
const isSpyReady = (spy) => {
if (Array.isArray(spy)) {
return spy[0].callCount >= spy[1];
Expand Down

0 comments on commit 0856113

Please sign in to comment.