Skip to content

Commit e8ef6fd

Browse files
committed
draft-06: additional format tests
1 parent d545553 commit e8ef6fd

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ runTest(4);
1515
runTest(6);
1616

1717
function runTest(draft) {
18-
var opts = {};
18+
var opts = {format: 'full'};
1919
if (draft == 4) opts.meta = false;
2020
var ajv = new Ajv(opts);
2121
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"homepage": "https://github.com/json-schema-org/JSON-Schema-Test-Suite#readme",
2323
"devDependencies": {
24-
"ajv": "^5.0.4-beta.0",
24+
"ajv": "^5.0.4-beta.1",
2525
"json-schema-test": "^1.3.0",
2626
"mocha": "^3.2.0"
2727
}

tests/draft6/optional/format.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@
7979
"description": "a valid URI Reference",
8080
"data": "abc",
8181
"valid": true
82+
},
83+
{
84+
"description": "a valid URI fragment",
85+
"data": "#fragment",
86+
"valid": true
87+
},
88+
{
89+
"description": "an invalid URI fragment",
90+
"data": "#frag\\ment",
91+
"valid": false
8292
}
8393
]
8494
},
@@ -97,6 +107,16 @@
97107
"description": "an invalid uri-template",
98108
"data": "http://example.com/dictionary/{term:1}/{term",
99109
"valid": false
110+
},
111+
{
112+
"description": "a valid uri-template without variables",
113+
"data": "http://example.com/dictionary",
114+
"valid": true
115+
},
116+
{
117+
"description": "a valid relative uri-template",
118+
"data": "dictionary/{term:1}/{term}",
119+
"valid": true
100120
}
101121
]
102122
},

0 commit comments

Comments
 (0)