forked from ajv-validator/ajv
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue ajv-validator#1061 - Update time and date-time format definitio…
…ns to support two digit and colon-less variants of timezone offset. Add tests. Update test eslint to include global after function.
- Loading branch information
1 parent
82112b0
commit 382c2b9
Showing
3 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ globals: | |
describe: false | ||
it: false | ||
before: false | ||
after: false | ||
beforeEach: false | ||
afterEach: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[ | ||
{ | ||
"description": "Support for alternative ISO-8601 timezone offset formats (#1061)", | ||
"schema": {"format": "date-time"}, | ||
"tests": [ | ||
{ | ||
"description": "valid positiive two digit", | ||
"data": "2016-01-31T02:31:17+01", | ||
"valid": true | ||
}, | ||
{ | ||
"description": "valid negative two digit", | ||
"data": "2016-01-31T02:31:17-01", | ||
"valid": true | ||
}, | ||
{ | ||
"description": "valid positiive four digit no colon", | ||
"data": "2016-01-31T02:31:17+0130", | ||
"valid": true | ||
}, | ||
{ | ||
"description": "valid negative four digit no colon", | ||
"data": "2016-01-31T02:31:17-0130", | ||
"valid": true | ||
}, | ||
{ | ||
"description": "invalid positiive three digit no colon", | ||
"data": "2016-01-31T02:31:17+013", | ||
"valid": false | ||
}, | ||
{ | ||
"description": "invalid negative three digit no colon", | ||
"data": "2016-01-31T02:31:17-013", | ||
"valid": false | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "Support for alternative ISO-8601 timezone offset formats (#1061)", | ||
"schema": {"format": "time"}, | ||
"tests": [ | ||
{ | ||
"description": "valid positiive two digit", | ||
"data": "02:31:17+01", | ||
"valid": true | ||
}, | ||
{ | ||
"description": "valid negative two digit", | ||
"data": "02:31:17-01", | ||
"valid": true | ||
}, | ||
{ | ||
"description": "valid positiive four digit no colon", | ||
"data": "02:31:17+0130", | ||
"valid": true | ||
}, | ||
{ | ||
"description": "valid negative four digit no colon", | ||
"data": "02:31:17-0130", | ||
"valid": true | ||
}, | ||
{ | ||
"description": "invalid positiive three digit no colon", | ||
"data": "02:31:17+013", | ||
"valid": false | ||
}, | ||
{ | ||
"description": "invalid negative three digit no colon", | ||
"data": "02:31:17-013", | ||
"valid": false | ||
} | ||
] | ||
} | ||
] |