init Karma

This commit is contained in:
Kent C. Dodds 2016-06-06 22:20:22 -06:00
parent 773782833a
commit db35e0049a
3 changed files with 29 additions and 0 deletions

15
karma.conf.js Normal file
View File

@ -0,0 +1,15 @@
module.exports = function setKarmaConfig(config) {
config.set({
basePath: '',
frameworks: ['mocha'],
files: ['src/js/**/*.test.js'],
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Chrome'],
singleRun: true,
concurrency: Infinity
})
}

View File

@ -17,6 +17,10 @@
"eslint-config-kentcdodds": "6.2.1",
"eslint-loader": "1.3.0",
"ghooks": "1.2.1",
"karma": "0.13.22",
"karma-chrome-launcher": "1.0.1",
"karma-mocha": "1.0.1",
"mocha": "2.5.3",
"npm-run-all": "1.8.0",
"opt-cli": "1.4.2",
"rimraf": "2.5.2",
@ -31,6 +35,8 @@
}
},
"scripts": {
"test": "karma start",
"watch:test": "npm test -- --auto-watch --no-single-run",
"validate": "npm-run-all --parallel validate-webpack:* lint",
"validate-webpack:dev": "webpack-validator webpack.config.js --env.dev",
"validate-webpack:prod": "webpack-validator webpack.config.js --env.prod",

View File

@ -0,0 +1,8 @@
describe('test', () => {
it('works', () => {
// test stuff
})
it('works again', () => {
// more tests
})
})