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 71dde47 commit 8a31d42
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 39 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
"description": "Curriculum Context: Referentiekader nederlandse taal en rekenen",
"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",
"uuid": "^3.3.2"
"uuid": "^3.3.2",
"curriculum-js": "^0.4.1"
}
}
36 changes: 0 additions & 36 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-referentiekader', '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 8a31d42

Please sign in to comment.