File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import * as util from "util";
44// Grab the setTimeout from global before jest overwrites it with useFakeTimers
55const setTimeoutBypassingFakes = global . setTimeout ;
66
7+ type Timeout = ReturnType < typeof setTimeout > ;
8+
79/**
810 * Wait a number of milliseconds of _real time_ (not mocked time); useful for
911 * allowing the runloop or external systems to advance.
@@ -13,8 +15,8 @@ const setTimeoutBypassingFakes = global.setTimeout;
1315export const sleep = (
1416 ms : number ,
1517 unref = false ,
16- ) : Promise < void > & { timeout : NodeJS . Timeout } => {
17- let timeout ! : NodeJS . Timeout ;
18+ ) : Promise < void > & { timeout : Timeout } => {
19+ let timeout ! : Timeout ;
1820 const promise = new Promise < void > ( ( resolve ) => {
1921 timeout = setTimeoutBypassingFakes ( resolve , ms ) ;
2022 } ) ;
You can’t perform that action at this time.
0 commit comments