add webpack

This commit is contained in:
Kent C. Dodds 2016-06-07 20:19:18 -06:00
parent b904de4b92
commit 13ee320b3e
3 changed files with 16 additions and 9 deletions

View File

@ -1,10 +1,17 @@
const webpackEnv = {test: true}
const webpackConfig = require('./webpack.config.babel')(webpackEnv)
const fileGlob = 'src/**/*.test.js'
module.exports = config => {
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: [
'src/**/*.test.js',
],
files: [fileGlob],
preprocessors: {
[fileGlob]: ['webpack']
},
webpack: webpackConfig,
webpackMiddleware: {noInfo: true},
reporters: ['progress'],
port: 9876,
colors: true,

View File

@ -19,6 +19,7 @@
"karma-chai": "0.1.0",
"karma-chrome-launcher": "1.0.1",
"karma-mocha": "1.1.1",
"karma-webpack": "1.7.0",
"mocha": "3.0.1",
"npm-run-all": "2.3.0",
"opt-cli": "1.5.1",

View File

@ -1,8 +1,7 @@
describe('test', () => {
it('works', () => {
expect(true).to.be.true
})
it('works again', () => {
expect('hi').to.equal('hi')
var Controller = require('./controller')
describe('controller', () => {
it('exists', () => {
expect(Controller).to.exist
})
})