File tree 4 files changed +48
-65
lines changed 4 files changed +48
-65
lines changed Original file line number Diff line number Diff line change 1
- // eslint-disable-next-line import/no-extraneous-dependencies
2
- const createBaseConfig = require ( '@open-wc/testing-karma/create-karma-config' ) ;
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ const defaultSettings = require ( '@open-wc/testing-karma/default-settings.js' ) ;
3
+ const merge = require ( 'webpack-merge' ) ;
3
4
4
- module . exports = ( config ) => {
5
- const baseConfig = createBaseConfig ( config ) ;
5
+ module . exports = config => {
6
+ config . set (
7
+ merge ( defaultSettings ( config ) , {
8
+ files : [
9
+ // allows running single tests with the --grep flag
10
+ config . grep ? config . grep : 'test/**/*.test.js' ,
11
+ ] ,
6
12
7
- config . set ( {
8
- ...baseConfig ,
9
-
10
- files : [
11
- // allows running single tests with the --grep flag
12
- config . grep ? config . grep : 'test/**/*.test.js' ,
13
- ] ,
14
-
15
- // TODO: not yet within the 90% default
16
- coverageIstanbulReporter : {
17
- thresholds : {
18
- global : {
19
- statements : 80 ,
20
- branches : 70 ,
21
- functions : 70 ,
22
- lines : 80 ,
13
+ // TODO: not yet within the 90% default
14
+ coverageIstanbulReporter : {
15
+ thresholds : {
16
+ global : {
17
+ statements : 80 ,
18
+ branches : 70 ,
19
+ functions : 70 ,
20
+ lines : 80 ,
21
+ } ,
23
22
} ,
24
23
} ,
25
- } ,
26
- } ) ;
24
+ } ) ,
25
+ ) ;
26
+ return config ;
27
27
} ;
Original file line number Diff line number Diff line change 1
- // eslint-disable-next-line import/no-extraneous-dependencies
2
- const createBaseConfig = require ( '@open-wc/testing-karma-bs/create-karma-es5-bs.config' ) ;
3
-
4
- module . exports = ( config ) => {
5
- const baseConfig = createBaseConfig ( config ) ;
6
-
7
- config . set ( {
8
- ...baseConfig ,
9
-
10
- files : [
11
- ...baseConfig . files ,
12
- // allows running single tests with the --grep flag
13
- config . grep ? [ config . grep ] : 'test/**/*.test.js' ,
14
- ] ,
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ const merge = require ( 'webpack-merge' ) ;
3
+ const bsSettings = require ( '@open-wc/testing-karma-bs/bs-settings.js' ) ;
4
+ const karmaEs5Config = require ( './karma.es5.config.js' ) ;
15
5
6
+ module . exports = config => {
7
+ config . set ( merge ( bsSettings ( config ) , karmaEs5Config ( config ) , {
16
8
browserStack : {
17
- ...baseConfig . browserStack ,
18
- project : 'example-vanilla-set-game' ,
19
- } ,
20
-
21
- // just an example build for chrome only
22
- browsers : [
23
- 'bs_win10_chrome_latest' ,
24
- // 'bs_win10_firefox_latest',
25
- // 'bs_win10_edge_latest',
26
- // 'bs_osxmojave_safari_latest',
27
- // 'bs_win10_ie_11',
28
- ] ,
29
-
30
- // TODO: not yet within the 90% default
31
- coverageIstanbulReporter : {
32
- thresholds : {
33
- global : {
34
- statements : 80 ,
35
- branches : 70 ,
36
- functions : 70 ,
37
- lines : 80 ,
38
- } ,
39
- } ,
40
- } ,
41
- } ) ;
9
+ project : 'your-name' ,
10
+ }
11
+ } ) ) ;
12
+ return config ;
42
13
} ;
Original file line number Diff line number Diff line change
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ const merge = require ( 'webpack-merge' ) ;
3
+ const es5Settings = require ( '@open-wc/testing-karma/es5-settings.js' ) ;
4
+ const karmaConf = require ( './karma.conf.js' ) ;
5
+
6
+ module . exports = config => {
7
+ config . set ( merge ( es5Settings ( config ) , karmaConf ( config ) ) ) ;
8
+ return config ;
9
+ } ;
Original file line number Diff line number Diff line change 17
17
"storybook:start" : " start-storybook -p 9001" ,
18
18
"test" : " karma start" ,
19
19
"test:watch" : " karma start --auto-watch=true --single-run=false" ,
20
+ "test:es5" : " karma start karma.es5.config.js" ,
21
+ "test:es5:watch" : " karma start karma.es5.config.js --auto-watch=true --single-run=false" ,
20
22
"test:es5:bs" : " karma start karma.es5.bs.config.js"
21
23
},
22
24
"devDependencies" : {
23
25
"@open-wc/eslint-config" : " ^0.3.0" ,
24
26
"@open-wc/storybook" : " ^0.2.0" ,
25
- "@open-wc/testing" : " ^0.7.0" ,
26
- "@open-wc/testing-karma" : " ^0.3.0" ,
27
- "@open-wc/testing-karma-bs" : " ^0.1.0" ,
28
- "@open-wc/testing-wallaby" : " ^0.1.3"
27
+ "@open-wc/testing" : " ^0.8.0" ,
28
+ "@open-wc/testing-karma" : " ^0.4.0" ,
29
+ "@open-wc/testing-karma-bs" : " ^0.2.0" ,
30
+ "@open-wc/testing-wallaby" : " ^0.1.3" ,
31
+ "webpack-merge" : " ^4.1.5"
29
32
}
30
33
}
You can’t perform that action at this time.
0 commit comments