diff --git a/test/helpers/index.js b/test/helpers/index.js index 114fa77..0165616 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -1,6 +1,10 @@ +/* global Bare */ + const nil = new Int32Array(new SharedArrayBuffer(4)) -exports.isAround = function isAround (actual, expected, epsilon = 10) { +const isWindows = Bare.platform === 'win32' + +exports.isAround = function isAround (actual, expected, epsilon = isWindows ? 50 : 25) { return Math.abs(actual - expected) < epsilon } diff --git a/test/timeout.js b/test/timeout.js index 7f89e18..cb95ac5 100644 --- a/test/timeout.js +++ b/test/timeout.js @@ -30,7 +30,7 @@ test('setTimeout refresh', async function (t) { const timer = timers.setTimeout(function () { t.is(ticks, 6, 'was refreshed') - t.ok(isAround(Date.now() - started, 200), 'timers took ' + Math.abs(Date.now() - started) + 'ms') + t.ok(isAround(Date.now() - started, 200, 100), 'timers took ' + Math.abs(Date.now() - started) + 'ms') }, 50) let ticks = 0