Skip to content

Commit

Permalink
Add tests for date limits.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Nov 29, 2023
1 parent c5bd744 commit d0517c0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/20-dateRegex.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('verifies RFC3339 Dates', function() {
});
});
describe('negative', function() {
it('should not verify a date that uses / as a separator', function() {
it('should not verify a date that uses "/" as a separator', function() {
assertInvalid('2017/09/27');
});
it('should not verify 2 digit years', function() {
Expand All @@ -60,5 +60,20 @@ describe('verifies RFC3339 Dates', function() {
function() {
assertInvalid('2019-03-26T14:00.9Z');
});
it('should not verify a day greater than 31 in a month', function() {
assertInvalid('2017-03-45T15:00:15Z');
});
it('should not verify a month greater than 12 in a year', function() {
assertInvalid('2017-14-22T15:00:15Z');
});
it('should not verify an hour greater than 24', function() {
assertInvalid('2017-10-22T25:00:15Z');
});
it('should not verify minutes greater than 60', function() {
assertInvalid('2017-10-22T15:75:15Z');
});
it('should not verify seconds greater than 60', function() {
assertInvalid('2017-10-22T15:15:65Z');
});
});
});

0 comments on commit d0517c0

Please sign in to comment.