Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix instability in polling tests #206

Merged
merged 1 commit into from Nov 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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