File tree 3 files changed +48
-2
lines changed
3 files changed +48
-2
lines changed Original file line number Diff line number Diff line change
1
+ /* eslint no-var: 0, no-unused-vars: 0 */
2
+ var path = require ( 'path' ) ;
3
+ var webpack = require ( 'webpack' ) ;
4
+
5
+ module . exports = function karmaConfig ( config ) {
6
+ config . set ( {
7
+ browsers : [ 'Chrome' ] ,
8
+ singleRun : true ,
9
+ // autoWatch: true,
10
+ frameworks : [ 'mocha' ] ,
11
+ files : [ './test.js' ] ,
12
+ preprocessors : {
13
+ './test.js' : [ 'webpack' , 'sourcemap' ]
14
+ } ,
15
+ reporters : [ 'mocha' ] ,
16
+ webpack : {
17
+ devtool : 'inline-source-map' ,
18
+ resolve : {
19
+ root : path . resolve ( __dirname , './src' )
20
+ } ,
21
+ module : {
22
+ loaders : [ {
23
+ test : / \. j s $ / ,
24
+ loader : 'babel' ,
25
+ exclude : / ( n o d e _ m o d u l e s ) /
26
+ } ]
27
+ }
28
+ } ,
29
+ // webpackMiddleware: {
30
+ // noInfo: true,
31
+ // watchOptions: { poll: 3000 }
32
+ // }
33
+ } ) ;
34
+ } ;
Original file line number Diff line number Diff line change 8
8
"build" : " babel src --out-dir lib" ,
9
9
"build:umd" : " webpack src/index.js dist/react-custom-scrollbars.js && NODE_ENV=production webpack src/index.js dist/react-custom-scrollbars.min.js" ,
10
10
"lint" : " eslint src test examples" ,
11
- "test" : " NODE_ENV=test mocha --compilers js:babel-register --recursive " ,
12
- "test:watch" : " NODE_ENV=test mocha --compilers js:babel-register --recursive --watch " ,
11
+ "test" : " NODE_ENV=test karma start " ,
12
+ "test:watch" : " NODE_ENV=test karma start --auto-watch --no-single-run " ,
13
13
"prepublish" : " npm run lint && npm run test && npm run clean && npm run build"
14
14
},
15
15
"repository" : {
44
44
"eslint-config-airbnb" : " ^0.1.0" ,
45
45
"eslint-plugin-react" : " ^3.5.1" ,
46
46
"expect" : " ^1.6.0" ,
47
+ "karma" : " ^0.13.10" ,
48
+ "karma-chrome-launcher" : " ^0.2.1" ,
49
+ "karma-cli" : " ^0.1.1" ,
50
+ "karma-mocha" : " ^0.2.0" ,
51
+ "karma-mocha-reporter" : " ^1.0.3" ,
52
+ "karma-sourcemap-loader" : " ^0.3.6" ,
53
+ "karma-webpack" : " ^1.6.0" ,
47
54
"mocha" : " ^2.2.5" ,
48
55
"react" : " ^0.14.3" ,
49
56
"react-dom" : " ^0.14.3" ,
Original file line number Diff line number Diff line change
1
+ import expect from 'expect' ;
2
+ window . expect = expect ;
3
+
4
+ const context = require . context ( './test' , true , / .* \. j s $ / ) ;
5
+ context . keys ( ) . forEach ( context ) ;
You can’t perform that action at this time.
0 commit comments