Files
jspg/fixtures/minLength.json

91 lines
1.9 KiB
JSON

[
{
"description": "minLength validation",
"database": {
"schemas": [
{
"minLength": 2,
"$id": "minLength_0_0"
}
]
},
"tests": [
{
"description": "longer is valid",
"data": "foo",
"schema_id": "minLength_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "exact length is valid",
"data": "fo",
"schema_id": "minLength_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "too short is invalid",
"data": "f",
"schema_id": "minLength_0_0",
"action": "validate",
"expect": {
"success": false
}
},
{
"description": "ignores non-strings",
"data": 1,
"schema_id": "minLength_0_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "one grapheme is not long enough",
"data": "💩",
"schema_id": "minLength_0_0",
"action": "validate",
"expect": {
"success": false
}
}
]
},
{
"description": "minLength validation with a decimal",
"database": {
"schemas": [
{
"minLength": 2,
"$id": "minLength_1_0"
}
]
},
"tests": [
{
"description": "longer is valid",
"data": "foo",
"schema_id": "minLength_1_0",
"action": "validate",
"expect": {
"success": true
}
},
{
"description": "too short is invalid",
"data": "f",
"schema_id": "minLength_1_0",
"action": "validate",
"expect": {
"success": false
}
}
]
}
]