setting up test runner
This commit is contained in:
parent
5bac5a1b8d
commit
58c59de4e2
3 changed files with 45 additions and 5 deletions
18
package.json
18
package.json
|
@ -12,7 +12,8 @@
|
|||
"scripts": {
|
||||
"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",
|
||||
"test": "standard"
|
||||
"pretest": "standard",
|
||||
"test": "mocha-phantomjs test/index.html"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -25,21 +26,28 @@
|
|||
}
|
||||
],
|
||||
"standard": {
|
||||
"parser": "babel-eslint",
|
||||
"ignore": [
|
||||
"dist",
|
||||
"assets"
|
||||
]
|
||||
"assets",
|
||||
"dist"
|
||||
],
|
||||
"global": [
|
||||
"describe",
|
||||
"it"
|
||||
],
|
||||
"parser": "babel-eslint"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^3.1.23",
|
||||
"babelify": "^6.1.3",
|
||||
"browserify": "^10.2.6",
|
||||
"browserify-handlebars": "^1.0.0",
|
||||
"chai": "^3.0.0",
|
||||
"cssmin": "^0.4.3",
|
||||
"exorcist": "^0.4.0",
|
||||
"handlebars": "^3.0.3",
|
||||
"mocha": "^2.2.5",
|
||||
"mocha-phantomjs": "^3.5.3",
|
||||
"phantomjs": "^1.9.17",
|
||||
"standard": "^4.5.3",
|
||||
"uglify-js": "^2.4.23"
|
||||
}
|
||||
|
|
22
test/index.html
Normal file
22
test/index.html
Normal 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>
|
10
test/lib/load-indicator.js
Normal file
10
test/lib/load-indicator.js
Normal 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')
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue