Skip to content

Commit

Permalink
updated curriculum-basis
Browse files Browse the repository at this point in the history
updated test script
  • Loading branch information
poef committed Sep 27, 2023
1 parent 8c1f02f commit 4cb5c83
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 47 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"description": "Leerdoelenkaarten Context",
"main": "context.json",
"scripts": {
"test": "node test/test.js"
"test": "node test/test.mjs"
},
"author": "SLO",
"license": "MIT",
"dependencies": {
"ajv": "^6.5.5",
"jsondiffpatch": "^0.3.11",
"node-fetch": "^2.3.0",
"uuid": "^3.3.2"
"uuid": "^3.3.2",
"curriculum-js": "^0.4.1"
}
}
44 changes: 0 additions & 44 deletions test/test.js

This file was deleted.

22 changes: 22 additions & 0 deletions test/test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Curriculum from 'curriculum-js'

async function validate() {

var curriculum = new Curriculum()
var basisSchema = await curriculum.loadContextFromFile('curriculum-basis', 'curriculum-basis/context.json');
var schema = await curriculum.loadContextFromFile('curriculum-leerdoelenkaarten', 'context.json');
try {
let result = await curriculum.validate(schema)
console.log('Data is valid!')
} catch(error) {
if (!error.validationErrors) {
console.error(error)
} else {
error.validationErrors.forEach(error => {
console.error(error.instancePath+': '+error.message)
})
}
}
}

validate()

0 comments on commit 4cb5c83

Please sign in to comment.