-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
193 additions
and
93 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
{ | ||
"presets": ["es2015"], | ||
"plugins": ["transform-runtime", "add-module-exports"] | ||
"plugins": ["lodash"], | ||
"env": { | ||
"test": { | ||
"plugins": [ | ||
["__coverage__", {"ignore": "*.+(test|spec).*"}] | ||
] | ||
} | ||
} | ||
} |
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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,87 @@ | ||
// Karma configuration | ||
'use strict'; | ||
|
||
var webpackConfig = require('./webpack.test'); | ||
var test = process.env.NODE_ENV === 'test'; | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
// base path, that will be used to resolve files and exclude | ||
basePath: '.', | ||
plugins: [ | ||
'karma-chrome-launcher', | ||
'karma-mocha', | ||
'karma-chai-plugins', | ||
'karma-sourcemap-loader', | ||
'karma-webpack', | ||
'karma-coverage', | ||
'karma-spec-reporter' | ||
], | ||
|
||
autoWatch: test, | ||
|
||
webpack: webpackConfig, | ||
|
||
webpackMiddleware: { | ||
noInfo: true | ||
}, | ||
|
||
client: { | ||
captureConsole: true | ||
}, | ||
|
||
// 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: [ | ||
'app/app.test.js' | ||
], | ||
|
||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
// run the bundle through the webpack and sourcemap plugins | ||
preprocessors: { | ||
'app/app.test.js': [ 'webpack', 'sourcemap' ] | ||
}, | ||
|
||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['spec', 'coverage'], | ||
|
||
|
||
coverageReporter: { | ||
reporters: [ | ||
{type: 'lcov', dir: 'coverage/', subdir: '.'}, | ||
{type: 'json', dir: 'coverage/', subdir: '.'}, | ||
{type: 'text-summary'} | ||
] | ||
}, | ||
|
||
// testing framework to use (jasmine/mocha/qunit/...) | ||
frameworks: ['jasmine'], | ||
|
||
// web server port | ||
port: 8080, | ||
port: 9876, | ||
|
||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
|
||
// level of logging | ||
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG | ||
// 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: false, | ||
|
||
// Start these browsers, currently available: | ||
// - Chrome | ||
// - ChromeCanary | ||
// - Firefox | ||
// - Opera | ||
// - Safari (only Mac) | ||
// - PhantomJS | ||
// - IE (only Windows) | ||
browsers: ['PhantomJS'], | ||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['Chrome'], | ||
|
||
|
||
// Continuous Integration mode | ||
// if true, it capture browsers, run tests and exit | ||
singleRun: false | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: !test | ||
}); | ||
}; |
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 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 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
Oops, something went wrong.