Also add 'hrtime' method.

This commit is contained in:
Rogier Schouten
2017-11-22 16:17:30 +01:00
parent 85205b1b8f
commit c6798928cb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ type Clock = BrowserClock | NodeClock;
/**
* Names of clock methods that may be faked by install.
*/
type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick";
type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime";
/**
* Controls the flow of time.
+1 -1
View File
@@ -22,7 +22,7 @@ lolex.install<lolex.BrowserClock>({
now: 0,
shouldAdvanceTime: true,
target: {},
toFake: ["setTimeout"]
toFake: ["setTimeout", "nextTick", "hrtime"]
});
const browserNow: number = browserClock.now;