Skip to content

Commit

Permalink
Make watch tests more resilient
Browse files Browse the repository at this point in the history
Ensure that new event listeners are created synchronously after a function handler
  • Loading branch information
lukastaegert committed Oct 12, 2022
1 parent 4ec23f8 commit 9d5f7c2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/watch/index.js
Expand Up @@ -61,10 +61,11 @@ describe('rollup.watch', () => {
}
});
} else {
Promise.resolve()
.then(() => wait(timeout)) // gah, this appears to be necessary to fix random errors
.then(() => next(event))
.then(go)
wait(timeout) // gah, this appears to be necessary to fix random errors
.then(() => {
next(event);
go();
})
.catch(error => {
watcher.close();
reject(error);
Expand Down

0 comments on commit 9d5f7c2

Please sign in to comment.