forked from mystiq/hydrogen-web
ensure second promise has run in test
This commit is contained in:
parent
4f4808b94c
commit
af423b1c7f
1 changed files with 4 additions and 4 deletions
|
@ -67,15 +67,15 @@ export function tests() {
|
||||||
const lock = new Lock();
|
const lock = new Lock();
|
||||||
lock.take();
|
lock.take();
|
||||||
|
|
||||||
let first = false;
|
let first;
|
||||||
lock.released().then(() => first = lock.take());
|
lock.released().then(() => first = lock.take());
|
||||||
let second = false;
|
let second;
|
||||||
lock.released().then(() => second = lock.take());
|
lock.released().then(() => second = lock.take());
|
||||||
const promise = lock.released();
|
const promise = lock.released();
|
||||||
lock.release();
|
lock.release();
|
||||||
await promise;
|
await promise;
|
||||||
assert.equal(first, true);
|
assert.strictEqual(first, true);
|
||||||
assert.equal(second, false);
|
assert.strictEqual(second, false);
|
||||||
},
|
},
|
||||||
"await non-taken lock": async assert => {
|
"await non-taken lock": async assert => {
|
||||||
const lock = new Lock();
|
const lock = new Lock();
|
||||||
|
|
Loading…
Reference in a new issue