Setup mocha for apiserver testing

This commit is contained in:
Tom Russell 2018-08-08 09:08:17 +01:00
parent 0c899f258d
commit 6e47e847f2
2 changed files with 16 additions and 1 deletions

View File

@ -4,12 +4,15 @@
"description": "Serve API queries",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha"
},
"author": "Tom Russell",
"license": "GPL-3.0",
"dependencies": {
"express": "^4.16.3",
"pg": "^7.4.3"
},
"devDependencies": {
"mocha": "^5.2.0"
}
}

12
apiserver/test/test.js Normal file
View File

@ -0,0 +1,12 @@
/**
* Demo test
*/
const assert = require('assert');
describe('Array', function() {
describe('#indexOf()', function() {
it('should return -1 when the value is not present', function() {
assert.equal([1,2,3].indexOf(4), -1);
});
});
});