-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jest-util): use lolex as implementation for fake timers
- Loading branch information
Showing
26 changed files
with
282 additions
and
927 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
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
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,50 @@ | ||
// flow-typed signature: a865cf1b7ee719c2a40b85dc8dccf56c | ||
// flow-typed version: fc3f3a2e99/lolex_v2.x.x/flow_>=v0.64.x | ||
|
||
// @flow | ||
declare module 'lolex' { | ||
declare opaque type ImmediateID; | ||
declare type installConfig = { | ||
target?: Object, | ||
now?: number | Date, | ||
toFake?: string[], | ||
loopLimit?: number, | ||
shouldAdvanceTime?: boolean, | ||
advanceTimeDelta?: number, | ||
}; | ||
declare type lolex = { | ||
createClock(now?: number, loopLimit?: number): Clock, | ||
install(config?: installConfig): Clock, | ||
timers: Object, | ||
withGlobal(global: Object): lolex, | ||
}; | ||
declare type Clock = { | ||
setTimeout: typeof setTimeout; | ||
clearTimeout: typeof clearTimeout; | ||
setInterval: typeof setInterval; | ||
clearInterval: typeof clearInterval; | ||
setImmediate: typeof setImmediate; | ||
clearImmediate: typeof clearImmediate; | ||
requestAnimationFrame: typeof requestAnimationFrame; | ||
cancelAnimationFrame: typeof cancelAnimationFrame; | ||
hrtime: typeof process.hrtime; | ||
nextTick: typeof process.nextTick; | ||
now: number; | ||
performance?: { | ||
now: typeof performance.now, | ||
}; | ||
tick(time: number | string): void; | ||
next(): void; | ||
reset(): void; | ||
runAll(): void; | ||
runMicrotasks(): void; | ||
runToFrame(): void; | ||
runToLast(): void; | ||
setSystemTime(now?: number | Date): void; | ||
uninstall(): Object[]; | ||
Date: typeof Date; | ||
Performance: typeof Performance; | ||
countTimers(): number; | ||
} | ||
declare module.exports: lolex; | ||
} |
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.