sleep
Resolves a promise after a specified timeout.
sleep(ms?: number): Promise<void>
Notes
- This method is asynchronous and must be
await
-ed. - You can omit the
ms
parameter to wait (asynchronously) only until the next ‘tick’
Parameters
- ms — The time to wait, in milliseconds
Example
describe("My scope", () => {
test("My test", async (t) => {
await t.sleep(100);
});
});
Related
- class TestCaseA class that represents a single test case, part of a TestScope.