Skip to content

Commit

Permalink
missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
pkuczynski committed Jan 21, 2022
1 parent f84c7f5 commit c03bd39
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/date.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ describe('date', () => {
expect(date).lessThan(refDate);
expect(date).greaterThan(new Date());
});

it('accepts reference date given as Date object', () => {
const refDate = new Date(2120, 11, 9, 10, 0, 0, 0); // set the date beyond the usual calculation (to make sure this is working correctly)

const date = faker.date.past(75, refDate);

// date should be before date given but after the current time
expect(date).lessThan(refDate);
expect(date).greaterThan(new Date());
});
});

describe('future()', () => {
Expand Down

0 comments on commit c03bd39

Please sign in to comment.