ILIAS is using Mocha as test framework for Javascript unit tests. The esm
extension allows to use ES6 modules seamlessly. Chai is being used as assertion library.
(not necessary as long as we keep npm modules in our git repo)
> npm i --save-dev mocha
> npm i --save-dev esm
> npm i --save-dev chai
{
...
"scripts": {
"test": "mocha --require esm"
},
...
}
> npm test
Your tests should be located in a subdirectory test
.