Skip to content
This repository has been archived by the owner on Jan 22, 2018. It is now read-only.

Commit

Permalink
😎 es6ify our webpack and karma configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Dec 15, 2015
1 parent a6efbc7 commit f8de2da
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 73 deletions.
72 changes: 72 additions & 0 deletions karma.conf.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Karma configuration

import webpackConfig from './webpack.config.babel'

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai', 'sinon-chai'],


// list of files / patterns to load in the browser
files: [
'js/**/*.test.js'
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'js/**/*.test.js': 'webpack'
},
webpack: webpackConfig,


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Firefox'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultanous
concurrency: Infinity
})
}
73 changes: 2 additions & 71 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,3 @@
// Karma configuration
require('babel-core/register')
module.exports = require('./karma.conf.babel')

var webpackConfig = require('./webpack.config')

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai', 'sinon-chai'],


// list of files / patterns to load in the browser
files: [
'js/**/*.test.js'
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'js/**/*.test.js': 'webpack'
},
webpack: webpackConfig,


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Firefox'],


// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

// Concurrency level
// how many browser should be started simultanous
concurrency: Infinity
})
}
4 changes: 2 additions & 2 deletions webpack.config.js β†’ webpack.config.babel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var path = require('path')
import path from 'path'

module.exports = {
export default {
context: path.resolve(__dirname, 'js'),
entry: './main',
output: {
Expand Down

0 comments on commit f8de2da

Please sign in to comment.