Skip to content

Commit

Permalink
Merge pull request #178 from SimenB/date-instanceof
Browse files Browse the repository at this point in the history
 Access Date on `_global`
  • Loading branch information
benjamingr authored May 15, 2018
2 parents 8f5bcb4 + 2bb03d6 commit 8fb9173
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions integration-test/lolex-integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,14 @@ describe("withGlobal", function () {

clock.uninstall();
});

it("Date is instanceof itself", function () {
assert(new jsdomGlobal.Date() instanceof jsdomGlobal.Date);

var clock = withGlobal.install({target: jsdomGlobal, toFake: timers});

assert(new jsdomGlobal.Date() instanceof jsdomGlobal.Date);

clock.uninstall();
});
});
2 changes: 1 addition & 1 deletion src/lolex-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function withGlobal(_global) {

_global.clearTimeout(timeoutResult);

var NativeDate = Date;
var NativeDate = _global.Date;
var uniqueTimerId = 1;

function isNumberFinite(num) {
Expand Down

0 comments on commit 8fb9173

Please sign in to comment.