Skip to content

Commit

Permalink
fix skipped tests
Browse files Browse the repository at this point in the history
by ensuring we are checking something meaningful.
  • Loading branch information
fatso83 committed Aug 24, 2024
1 parent eb7923a commit 35363ee
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/fake-timers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3155,7 +3155,7 @@ describe("FakeTimers", function () {
});
});

describe("date", function () {
describe("Date", function () {
beforeEach(function () {
this.now = new GlobalDate().getTime() - 3000;
this.clock = FakeTimers.createClock(this.now);
Expand All @@ -3182,17 +3182,14 @@ describe("FakeTimers", function () {
assert(typeof date === "string");
});

it.skip("creates real Date objects when Date constructor is gone", function () {
it("creates real Date objects when Date constructor is gone", function () {
const realDate = new Date();
Date = NOOP; // eslint-disable-line no-global-assign
global.Date = NOOP;

const date = new this.clock.Date();

assert.same(
date.constructor.prototype,
realDate.constructor.prototype,
);
assert(date instanceof realDate.constructor);
});

it("creates Date objects representing clock time", function () {
Expand Down Expand Up @@ -3300,8 +3297,8 @@ describe("FakeTimers", function () {
assert.equals(fakeDateStr, new this.clock.Date().toString());
});

it.skip("mirrors native Date.prototype", function () {
assert.same(this.clock.Date.prototype, Date.prototype);
it("creates objects that are instances of Date", function () {
assert(new this.clock.Date() instanceof Date);
});

it("supports now method if present", function () {
Expand Down

0 comments on commit 35363ee

Please sign in to comment.