-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(multichain-testing): long awaits use
stir
for no AVA timeout
- Loading branch information
1 parent
feae722
commit 8bb71eb
Showing
9 changed files
with
267 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import test from '@endo/ses-ava/prepare-endo.js'; | ||
import { sleep } from '../tools/sleep.js'; | ||
|
||
test('sleep without tripping AVA timeout', async t => { | ||
const stirred: string[] = []; | ||
t.timeout(500); | ||
const sleepTime = 4_000; | ||
await sleep(sleepTime, { | ||
log: t.log, | ||
stirEveryMs: 300, | ||
stir: description => { | ||
stirred.push(description); | ||
t.pass(description); | ||
}, | ||
}); | ||
const stirs = new Array(13); | ||
for (let i = 0; i < stirs.length; i += 1) { | ||
stirs[i] = `stir #${i + 1}`; | ||
} | ||
const expected = [`sleeping for ${sleepTime}ms...`, ...stirs]; | ||
t.deepEqual(stirred, expected); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.