mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-22 07:37:40 +00:00
chore(web): also pulls up the timeoutPromise unit-test fix
This commit is contained in:
parent
30c23760ae
commit
201985d673
1 changed files with 4 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ describe("TimeoutPromise", () => {
|
|||
assert.isTrue(await promise.corePromise);
|
||||
|
||||
const end = Date.now();
|
||||
// https://github.com/nodejs/node/issues/26578 - setTimeout() may resolve 1ms early than requested.
|
||||
assert.isAtLeast(end-start, INTERVAL);
|
||||
});
|
||||
|
||||
|
|
@ -59,7 +60,8 @@ describe("TimeoutPromise", () => {
|
|||
|
||||
const end = Date.now();
|
||||
assert.isAtMost(end-start, INTERVAL-1); // completes early
|
||||
assert.isAtLeast(end-start, INTERVAL/2); // but not TOO early
|
||||
// https://github.com/nodejs/node/issues/26578 - setTimeout() may resolve 1ms early than requested.
|
||||
assert.isAtLeast(end-start, INTERVAL/2-1); // but not TOO early
|
||||
});
|
||||
|
||||
it('late dual fulfillment does not change first result', async () => {
|
||||
|
|
@ -69,6 +71,7 @@ describe("TimeoutPromise", () => {
|
|||
assert.isTrue(await promise.corePromise);
|
||||
|
||||
const end = Date.now();
|
||||
// https://github.com/nodejs/node/issues/26578 - setTimeout() may resolve 1ms early than requested.
|
||||
assert.isAtLeast(end-start, INTERVAL);
|
||||
|
||||
promise.resolve(false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue