aboutsummaryrefslogtreecommitdiff
path: root/test/modules/date.spec.ts
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2024-02-27 20:57:27 +0100
committerGitHub <[email protected]>2024-02-27 19:57:27 +0000
commit4ab073164beab2bf690d7fffc7773e7b76d8e07e (patch)
tree1549dc0aba1646f27edcc00f1651f74a0b5b21fb /test/modules/date.spec.ts
parent0d4cba637cdd38e7757ecca1b7eae75d7a737fa8 (diff)
downloadfaker-4ab073164beab2bf690d7fffc7773e7b76d8e07e.tar.xz
faker-4ab073164beab2bf690d7fffc7773e7b76d8e07e.zip
feat!: high precision random number generator (#2357)
Diffstat (limited to 'test/modules/date.spec.ts')
-rw-r--r--test/modules/date.spec.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/modules/date.spec.ts b/test/modules/date.spec.ts
index 9d4ae9ad..d2e08337 100644
--- a/test/modules/date.spec.ts
+++ b/test/modules/date.spec.ts
@@ -830,22 +830,23 @@ describe('date', () => {
faker.setDefaultRefDate(() => new Date(Date.UTC(2020, 0, 1)));
faker.seed(20200101);
const date = faker.date.past();
- expect(date).toEqual(new Date('2019-02-25T21:52:41.824Z'));
+ expect(date).toBeInstanceOf(Date);
+ expect(date).toMatchInlineSnapshot('2019-02-25T21:52:41.819Z');
faker.seed(20200101);
const date2 = faker.date.past();
- expect(date2).toEqual(new Date('2019-02-25T21:52:41.824Z'));
+ expect(date2).toMatchInlineSnapshot('2019-02-25T21:52:41.819Z');
});
it('should use the refDateSource when refDate is not provided (with value)', () => {
faker.setDefaultRefDate(Date.UTC(2020, 0, 1));
faker.seed(20200101);
const date = faker.date.past();
- expect(date).toEqual(new Date('2019-02-25T21:52:41.824Z'));
+ expect(date).toMatchInlineSnapshot('2019-02-25T21:52:41.819Z');
faker.seed(20200101);
const date2 = faker.date.past();
- expect(date2).toEqual(new Date('2019-02-25T21:52:41.824Z'));
+ expect(date2).toMatchInlineSnapshot('2019-02-25T21:52:41.819Z');
});
});
});