-
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): stir for no AVA timeout in long awaits
- Loading branch information
1 parent
7940ef4
commit 90c02f8
Showing
5 changed files
with
102 additions
and
7 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,26 @@ | ||
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); | ||
}, | ||
}); | ||
t.like(stirred, { | ||
length: 15, | ||
0: `sleeping for ${sleepTime}ms...`, | ||
1: `while sleeping (1/14)`, | ||
2: `while sleeping (2/14)`, | ||
// ... | ||
13: `while sleeping (13/14)`, | ||
14: `while sleeping (14/14)`, | ||
15: undefined, | ||
}); | ||
}); |
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