-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests around the default property
- Loading branch information
1 parent
3cef243
commit f57888c
Showing
2 changed files
with
98 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[ | ||
{ | ||
"description": "invalid type for default", | ||
"schema": { | ||
"properties": { | ||
"foo": { | ||
"type": "integer", | ||
"default": [] | ||
} | ||
} | ||
}, | ||
"tests": [ | ||
{ | ||
"description": "valid when property is specified", | ||
"data": {"foo": 13}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "still valid when the invalid default is used", | ||
"data": {}, | ||
"valid": true | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "invalid string value for default", | ||
"schema": { | ||
"properties": { | ||
"bar": { | ||
"type": "string", | ||
"minLength": 4, | ||
"default": "bad" | ||
} | ||
} | ||
}, | ||
"tests": [ | ||
{ | ||
"description": "valid when property is specified", | ||
"data": {"bar": "good"}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "still valid when the invalid default is used", | ||
"data": {}, | ||
"valid": true | ||
} | ||
] | ||
} | ||
] |
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,49 @@ | ||
[ | ||
{ | ||
"description": "invalid type for default", | ||
"schema": { | ||
"properties": { | ||
"foo": { | ||
"type": "integer", | ||
"default": [] | ||
} | ||
} | ||
}, | ||
"tests": [ | ||
{ | ||
"description": "valid when property is specified", | ||
"data": {"foo": 13}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "still valid when the invalid default is used", | ||
"data": {}, | ||
"valid": true | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "invalid string value for default", | ||
"schema": { | ||
"properties": { | ||
"bar": { | ||
"type": "string", | ||
"minLength": 4, | ||
"default": "bad" | ||
} | ||
} | ||
}, | ||
"tests": [ | ||
{ | ||
"description": "valid when property is specified", | ||
"data": {"bar": "good"}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "still valid when the invalid default is used", | ||
"data": {}, | ||
"valid": true | ||
} | ||
] | ||
} | ||
] |