Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(faker): specify refDate to fix value of faker.date.past()
As shown in the following code, the result changes even if the seed is added: ``` > const { faker } = require("@faker-js/faker") undefined > faker.seed(0) 0 > const a = faker.date.past().toISOString() undefined > a '2022-03-08T21:45:15.158Z' > faker.seed(0) 0 > const b = faker.date.past().toISOString() undefined > b '2022-03-08T21:45:30.411Z' > a === b false ``` This is because the default refDate passed in the second argument of faker.date.past() is now, so we can fix it at a specific date. ref: faker-js/faker#859
- Loading branch information