add webpack

This commit is contained in:
Kent C. Dodds 2016-06-07 20:19:18 -06:00
parent 2dbe46425a
commit 6babcb3348
3 changed files with 16 additions and 7 deletions

View File

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

View File

@ -22,6 +22,7 @@
"karma-chai": "0.1.0",
"karma-chrome-launcher": "1.0.1",
"karma-mocha": "1.0.1",
"karma-webpack": "1.7.0",
"mocha": "2.5.3",
"npm-run-all": "1.8.0",
"opt-cli": "1.4.2",

View File

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