Skip to content

Commit a8f9f82

Browse files
committed
fix: ajv test to use id/$id correctly
1 parent 86f965e commit a8f9f82

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: python
22
python: "2.7"
3-
node_js: "6"
3+
node_js: "9"
44
install:
55
- pip install tox
66
- npm install

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const SKIP = {
2727
if (draft == 7) {
2828
ajv = new Ajv({format: 'full'});
2929
} else {
30-
ajv = new Ajv({format: 'full', meta: false});
30+
const schemaId = draft == 4 ? 'id' : '$id';
31+
ajv = new Ajv({format: 'full', meta: false, schemaId});
3132
ajv.addMetaSchema(require(`ajv/lib/refs/json-schema-draft-0${draft}.json`));
3233
ajv._opts.defaultMeta = `http://json-schema.org/draft-0${draft}/schema#`;
3334
}

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": "^6.0.0-rc.0",
24+
"ajv": "^6.0.0-rc.1",
2525
"json-schema-test": "^2.0.0",
2626
"mocha": "^3.2.0"
2727
}

0 commit comments

Comments
 (0)