korzio / djv

Dynamic JSON Schema Validator - Supports draft-04/06
https://www.npmjs.com/package/djv
MIT License
289 stars 31 forks source link

Fix failing tests draft-04/06, update schema usage #78

Closed korzio closed 5 years ago

korzio commented 5 years ago
Given a draft-04/06 meta schema update
When running unit tests
Then 17? tests are failing

https://github.com/ebdrup/json-schema-benchmark/pull/37

Links:

Test branch:


Most tests are failing because of \\ in the schema ids

SyntaxError: Invalid or unexpected token
    at new Function (<anonymous>)
    at restore (/Developer/schema/djv/lib/utils/template.js:124:15)
    at generate (/Developer/schema/djv/lib/utils/state.js:50:10)
    at Environment.addSchema (/Developer/schema/djv/lib/djv.js:90:11)
    at Object.validate (/Developer/schema/djv/test/json-schema-test-suite.js:23:13)
    at doTest (/Developer/schema/djv/node_modules/json-schema-test/index.js:79:43)
    at UserContext.<anonymous> (/Developer/schema/djv/node_modules/json-schema-test/index.js:66:30)
    at attempt (/Developer/schema/djv/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4478:46)
    at QueueRunner.run (/Developer/schema/djv/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4402:20)
    at QueueRunner.execute (/Developer/schema/djv/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4384:10)
result: false
expected:  true
errors: [ 'Invalid or unexpected token' ]
FSyntaxError: Invalid or unexpected token
    at new Function (<anonymous>)
    at restore (/Developer/schema/djv/lib/utils/template.js:124:15)
    at generate (/Developer/schema/djv/lib/utils/state.js:50:10)
    at Environment.addSchema (/Developer/schema/djv/lib/djv.js:90:11)
    at Object.validate (/Developer/schema/djv/test/json-schema-test-suite.js:23:13)
    at doTest (/Developer/schema/djv/node_modules/json-schema-test/index.js:79:43)
    at UserContext.<anonymous> (/Developer/schema/djv/node_modules/json-schema-test/index.js:66:30)
    at attempt (/Developer/schema/djv/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4478:46)
    at QueueRunner.run (/Developer/schema/djv/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4402:20)
    at QueueRunner.execute (/Developer/schema/djv/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4384:10)
korzio commented 5 years ago
korzio commented 5 years ago

Thanks @openself ! Starting to release the fix - https://github.com/korzio/djv/issues/81