@@ -7,8 +7,9 @@ let build = require('./lib/index');
77let testConfig = build . config . test ;
88let path = require ( 'path' ) ;
99let bindPolyfillPath = require . resolve ( 'phantomjs-polyfill/bind-polyfill.js' ) ;
10+ let debugRun = ( process . argv . indexOf ( '--debug' ) > - 1 ) ;
1011
11- module . exports = function ( config ) {
12+ module . exports = function ( config ) {
1213
1314 config . set ( {
1415
@@ -18,12 +19,11 @@ module.exports = function(config) {
1819
1920 // frameworks to use
2021 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
21- //frameworks: ['mocha', 'common_js'],
22- frameworks : [ 'mocha' ] ,
22+ frameworks : testConfig . frameworks ,
2323
2424
2525 // list of files / patterns to load in the browser
26- files : [ bindPolyfillPath ] . concat ( testConfig . paths . include ) ,
26+ files : [ bindPolyfillPath ] . concat ( testConfig . paths . include ) ,
2727
2828
2929 // list of files to exclude
@@ -33,8 +33,7 @@ module.exports = function(config) {
3333 // preprocess matching files before serving them to the browser
3434 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
3535 preprocessors : {
36- 'lib/**/!(*.test).js' : [ 'coverage' , 'webpack' ] ,
37- '**/*.test.js' : [ 'webpack' ]
36+ [ testConfig . paths . include [ 0 ] ] : [ 'webpack' ]
3837 } ,
3938
4039
@@ -53,9 +52,15 @@ module.exports = function(config) {
5352 } ,
5453
5554 webpack : {
56- // webpack configuration
55+ // webpack configuration
5756 module : {
58- postLoaders : [ {
57+ loaders : [
58+ {
59+ test : / s i n o n \. j s $ / ,
60+ loader : "imports?define=>false"
61+ }
62+ ] ,
63+ postLoaders : debugRun ? null : [ {
5964 test : / \. j s / ,
6065 exclude : / ( t e s t | n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) / ,
6166 loader : require . resolve ( 'istanbul-instrumenter-loader' )
@@ -77,6 +82,7 @@ module.exports = function(config) {
7782
7883 plugins : [
7984 require ( 'karma-mocha' ) ,
85+ require ( 'karma-sinon' ) ,
8086 require ( 'istanbul-instrumenter-loader' ) ,
8187 require ( 'karma-coverage' ) ,
8288 require ( 'karma-mocha-clean-reporter' ) ,
0 commit comments