setting up test runner

This commit is contained in:
Bala Clark 2015-07-13 22:38:53 +02:00
parent 5bac5a1b8d
commit 58c59de4e2
3 changed files with 45 additions and 5 deletions

View file

@ -12,7 +12,8 @@
"scripts": { "scripts": {
"build": "npm run build", "build": "npm run build",
"buildjs": "rm -f dist/*.js && browserify --transform babelify --transform browserify-handlebars app/index.js --debug | exorcist dist/comicbook.js.map > dist/comicbook.js", "buildjs": "rm -f dist/*.js && browserify --transform babelify --transform browserify-handlebars app/index.js --debug | exorcist dist/comicbook.js.map > dist/comicbook.js",
"test": "standard" "pretest": "standard",
"test": "mocha-phantomjs test/index.html"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -25,21 +26,28 @@
} }
], ],
"standard": { "standard": {
"parser": "babel-eslint",
"ignore": [ "ignore": [
"dist", "assets",
"assets" "dist"
] ],
"global": [
"describe",
"it"
],
"parser": "babel-eslint"
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "^3.1.23", "babel-eslint": "^3.1.23",
"babelify": "^6.1.3", "babelify": "^6.1.3",
"browserify": "^10.2.6", "browserify": "^10.2.6",
"browserify-handlebars": "^1.0.0", "browserify-handlebars": "^1.0.0",
"chai": "^3.0.0",
"cssmin": "^0.4.3", "cssmin": "^0.4.3",
"exorcist": "^0.4.0", "exorcist": "^0.4.0",
"handlebars": "^3.0.3", "handlebars": "^3.0.3",
"mocha": "^2.2.5", "mocha": "^2.2.5",
"mocha-phantomjs": "^3.5.3",
"phantomjs": "^1.9.17",
"standard": "^4.5.3", "standard": "^4.5.3",
"uglify-js": "^2.4.23" "uglify-js": "^2.4.23"
} }

22
test/index.html Normal file
View file

@ -0,0 +1,22 @@
<html>
<head>
<meta charset="utf-8">
<!-- encoding must be set for mocha's special characters to render properly -->
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script>
mocha.ui('bdd');
mocha.reporter('html');
assert = chai.assert
</script>
<script src="lib/load-indicator.js"></script>
<script>
if (window.mochaPhantomJS) mochaPhantomJS.run()
else mocha.run()
</script>
</body>
</html>

View file

@ -0,0 +1,10 @@
'use strict'
describe('#loadIndicator()', function () {
it('should render')
it('should emit a "show" event')
it('should emit a "hide" event')
})