Skip to content

Commit

Permalink
add unit test for issue#504 (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon authored Sep 13, 2024
1 parent 7802420 commit ed43eb8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/issue-504-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use strict";

const { FakeTimers, assert } = require("./helpers/setup-tests");

describe("issue #504", function () {
it("should not mutate Date class", function () {
const priorDate = new Date();
assert.equals(priorDate instanceof Date, true);

const clock = FakeTimers.install();

const afterDate = new Date();
assert.equals(priorDate instanceof Date, true);
assert.equals(afterDate instanceof Date, true);

clock.uninstall();
});
});

0 comments on commit ed43eb8

Please sign in to comment.