Improve test
This commit is contained in:
parent
0612f15aad
commit
9c61927c1b
1 changed files with 11 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ describe("Document Lock Operations", () => {
|
||||||
|
|
||||||
let firstResolved = false;
|
let firstResolved = false;
|
||||||
let secondResolved = false;
|
let secondResolved = false;
|
||||||
|
let thirdResolved = false;
|
||||||
|
|
||||||
const firstWaitPromise = waitForDocumentLock(testPath).then(() => {
|
const firstWaitPromise = waitForDocumentLock(testPath).then(() => {
|
||||||
firstResolved = true;
|
firstResolved = true;
|
||||||
|
|
@ -67,13 +68,23 @@ describe("Document Lock Operations", () => {
|
||||||
secondResolved = true;
|
secondResolved = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const thirdWaitPromise = waitForDocumentLock(testPath).then(() => {
|
||||||
|
thirdResolved = true;
|
||||||
|
});
|
||||||
|
|
||||||
unlockDocument(testPath);
|
unlockDocument(testPath);
|
||||||
await firstWaitPromise;
|
await firstWaitPromise;
|
||||||
expect(firstResolved).toBe(true);
|
expect(firstResolved).toBe(true);
|
||||||
expect(secondResolved).toBe(false);
|
expect(secondResolved).toBe(false);
|
||||||
|
expect(thirdResolved).toBe(false);
|
||||||
|
|
||||||
unlockDocument(testPath);
|
unlockDocument(testPath);
|
||||||
await secondWaitPromise;
|
await secondWaitPromise;
|
||||||
expect(secondResolved).toBe(true);
|
expect(secondResolved).toBe(true);
|
||||||
|
expect(thirdResolved).toBe(false);
|
||||||
|
|
||||||
|
unlockDocument(testPath);
|
||||||
|
await thirdWaitPromise;
|
||||||
|
expect(thirdResolved).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue