Created
August 4, 2017 19:04
-
-
Save jasongonzales23/8c71a116efdfd12714036f6d698dff2a to your computer and use it in GitHub Desktop.
webpack karma config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this one was in KPW | |
import { argv } from 'yargs' | |
import config from '../config' | |
import webpackConfig from './webpack.config' | |
import _debug from 'debug' | |
const debug = _debug('app:karma') | |
debug('Create configuration.') | |
module.exports = function(cfg) { | |
cfg.set({ | |
basePath: '', | |
browsers: ['PhantomJS'], | |
frameworks: ['mocha'], | |
files: [ | |
'../tests/**/*.js' | |
], | |
preprocessors: { | |
'../src/**/*.js': ['webpack', 'sourcemap'], | |
'../tests/**/*.js': ['webpack', 'sourcemap'] | |
}, | |
webpack: webpackConfig, | |
webpackMiddleware: { | |
stats: 'errors-only' | |
}, | |
plugins: [ | |
'karma-webpack', | |
'karma-mocha', | |
'karma-nyan-reporter', | |
'karma-sourcemap-loader', | |
'karma-chrome-launcher', | |
'karma-phantomjs-launcher' | |
], | |
reporters: ['nyan'], | |
nyanReporter: { | |
suppressErrorHighlighting: true, | |
}, | |
port: 9876, | |
colors: true, | |
logLevel: cfg.LOG_INGO, | |
autoWatch: true, | |
singleRun: !argv.watch, | |
}) | |
} | |
const path = require('path'); | |
const webpackConfig = require('./webpack.config.js') | |
module.exports = function(config) { | |
config.set({ | |
basePath: '', | |
browsers: ['PhantomJS'], | |
frameworks: ['mocha'], | |
files: [ | |
'tests/**/*.js' | |
], | |
preprocessors: { | |
'tests/**/*.js': ['webpack'] | |
}, | |
webpack: webpackConfig, | |
webpackServer: { | |
noInfo: true | |
}, | |
reporters: ['nyan'], | |
nyanReporter: { | |
suppressErrorHighlighting: true, | |
}, | |
port: 9876, | |
colors: true, | |
logLevel: config.LOG_INFO, | |
autoWatch: true, | |
singleRun: false, | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment