JS unit tests

This uses Karma with mocha+chai and browserify+babel. The tests
currently need to be run in a browser because we currently depend on
non node.js features (Blob and FileReader)

To run the tests go to <noms>/js/ and do `npm run start-test`.

Issue #256
This commit is contained in:
Erik Arvidsson
2015-09-02 19:36:07 -04:00
parent d06da3ca0a
commit 4639ca383a
4 changed files with 197 additions and 32 deletions
+14 -1
View File
@@ -6,10 +6,23 @@
},
"devDependencies": {
"babel": "^5.6.23",
"babelify": "^6.3.0",
"browserify": "^11.0.1",
"chai": "^3.2.0",
"karma": "^0.13.9",
"karma-babel-preprocessor": "^5.2.2",
"karma-browserify": "^4.3.0",
"karma-chrome-launcher": "^0.2.0",
"karma-firefox-launcher": "^0.1.6",
"karma-ie-launcher": "^0.2.0",
"karma-mocha": "^0.2.0",
"karma-safari-launcher": "^0.1.1",
"mocha": "^2.3.0",
"whatwg-fetch": "^0.9.0"
},
"scripts": {
"start": "babel -w src/ -d dist/",
"build": "babel src/ -d dist/"
"build": "babel src/ -d dist/",
"start-test": "karma start"
}
}