We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de0768c commit 8f2d5c8Copy full SHA for 8f2d5c8
test/date.spec.ts
@@ -558,6 +558,19 @@ describe('date', () => {
558
new Date().getUTCFullYear() - min
559
);
560
});
561
+
562
+ it('should throw an error when the min > max year', () => {
563
+ const min = 2000;
564
+ const max = 1990;
565
566
+ expect(() =>
567
+ faker.date.birthdate({ min, max, mode: 'year' })
568
+ ).toThrow(
569
+ new FakerError(
570
+ `Max 662515200000 should be larger then min 946771200000.`
571
+ )
572
+ );
573
+ });
574
575
576
describe('deprecated', () => {
0 commit comments