cover more lines

This commit is contained in:
Kent C. Dodds 2016-06-07 21:11:09 -06:00
parent 9d9b416940
commit 0d1c07cf62
5 changed files with 22 additions and 4 deletions

View File

@ -3,7 +3,7 @@
"env": {
"test": {
"plugins": [
["__coverage__", {"ignore": "*.test.*"}]
["__coverage__", {"ignore": "*.+(test|stub).*"}]
]
}
}

View File

@ -42,7 +42,7 @@
"scripts": {
"test": "karma start",
"watch:test": "npm test -- --auto-watch --no-single-run",
"validate": "npm-run-all --parallel validate-webpack:* lint",
"validate": "npm-run-all --parallel validate-webpack:* lint test",
"validate-webpack:dev": "webpack-validator webpack.config.js --env.dev",
"validate-webpack:prod": "webpack-validator webpack.config.js --env.prod",
"clean-dist": "rimraf dist",

View File

@ -1,7 +1,12 @@
import getModelStub from './model.stub'
import getViewStub from './view.stub'
import Controller from './controller'
describe('controller', () => {
it('exists', () => {
expect(Controller).to.exist
it('can be created', () => {
const view = getViewStub()
const model = getModelStub()
const controller = new Controller(model, view)
expect(controller).to.exist
})
})

6
src/js/model.stub.js Normal file
View File

@ -0,0 +1,6 @@
export default getModelStub
function getModelStub() {
return {
}
}

7
src/js/view.stub.js Normal file
View File

@ -0,0 +1,7 @@
export default getViewStub
function getViewStub() {
return {
bind: function() {}
}
}