Skip to content

Commit

Permalink
use lolex factory
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 7, 2018
1 parent 127d07d commit 7766475
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 42 deletions.
13 changes: 9 additions & 4 deletions flow-typed/npm/lolex_v2.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
// flow-typed version: <<STUB>>/lolex_v2/flow_v0.61.0

declare module 'lolex' {
declare module.exports: {|
createClock(now?: number, loopLimit?: number): LolexClock;
install(config?: LolexConfig): LolexClock;
|};
declare module.exports: LolexExports;
}

type LolexExports = {|
createClock(now?: number, loopLimit?: number): LolexClock;
install(config?: LolexConfig): LolexClock;
timers: {},
lolexFromGlobal(global: any): LolexExports
|}

type LolexClock = {|
setTimeout: setTimeout;
clearTimeout: clearTimeout;
Expand All @@ -25,6 +29,7 @@ type LolexClock = {|
tick(time: number | String): void;
next(): void;
runAll(): void;
runMicrotasks(): void;
runToFrame(): void;
runToLast(): void;
setSystemTime(now?: number): void;
Expand Down
Loading

0 comments on commit 7766475

Please sign in to comment.