Skip to content

Commit

Permalink
Merge pull request #206 from markjm/markjm/stabilize-tests
Browse files Browse the repository at this point in the history
test: fix instability in polling tests
  • Loading branch information
sokra committed Nov 24, 2021
2 parents c651129 + d7b98c5 commit 12f5ebc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/helpers/TestHelper.js
Expand Up @@ -119,9 +119,11 @@ TestHelper.prototype.remove = function remove(name) {
};

TestHelper.prototype.tick = function tick(arg, fn) {
// if polling is set, ensure the tick is longer than the polling interval.
let defaultTick = (+process.env.WATCHPACK_POLLING || 100) + 10;
if (typeof arg === "function") {
fn = arg;
arg = 100;
arg = defaultTick;
}
setTimeout(function() {
fn();
Expand Down

0 comments on commit 12f5ebc

Please sign in to comment.