Skip to content

Instantly share code, notes, and snippets.

@jasongonzales23
Created August 4, 2017 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongonzales23/8c71a116efdfd12714036f6d698dff2a to your computer and use it in GitHub Desktop.
Save jasongonzales23/8c71a116efdfd12714036f6d698dff2a to your computer and use it in GitHub Desktop.
webpack karma config
// 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,
})
}
// PDF
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