File tree 3 files changed +8
-6
lines changed
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ module.exports = (config) => {
37
37
38
38
files: [
39
39
// all files ending in ".test.js"
40
- ' test/**/*.test.js' ,
40
+ // !!! use watched: false as we use webpacks watch
41
+ { pattern: ' test/**/*.test.js' , watched: false }
41
42
],
42
43
43
44
preprocessors: {
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ class KarmaWebpackController {
108
108
constructor ( ) {
109
109
this . isActive = false ;
110
110
this . bundlesContent = { } ;
111
- this . __debounce = false ;
111
+ this . hasBeenBuiltAtLeastOnce = false ;
112
112
this . webpackOptions = defaultWebpackOptions ;
113
113
}
114
114
@@ -117,7 +117,7 @@ class KarmaWebpackController {
117
117
}
118
118
119
119
async bundle ( ) {
120
- if ( this . isActive === false && this . __debounce === false ) {
120
+ if ( this . isActive === false && this . hasBeenBuiltAtLeastOnce === false ) {
121
121
console . log ( 'Webpack bundling...' ) ;
122
122
this . _activePromise = this . _bundle ( ) ;
123
123
}
@@ -126,7 +126,6 @@ class KarmaWebpackController {
126
126
127
127
async _bundle ( ) {
128
128
this . isActive = true ;
129
- this . __debounce = true ;
130
129
this . compiler = webpack ( this . webpackOptions ) ;
131
130
return new Promise ( ( resolve ) => {
132
131
if ( this . webpackOptions . watch === true ) {
@@ -159,8 +158,8 @@ class KarmaWebpackController {
159
158
console . warn ( info . warnings ) ;
160
159
}
161
160
162
- this . __debounce = setTimeout ( ( ) => ( this . __debounce = false ) , 100 ) ;
163
161
this . isActive = false ;
162
+ this . hasBeenBuiltAtLeastOnce = true ;
164
163
165
164
console . log ( stats . toString ( this . webpackOptions . stats ) ) ;
166
165
resolve ( ) ;
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ function configToWebpackEntries(config) {
42
42
const { preprocessors } = config ;
43
43
44
44
let files = [ ] ;
45
- config . files . forEach ( ( fileEntry ) => {
45
+ config . files . forEach ( ( fileEntry , i ) => {
46
+ // forcefully disable karma watch as we use webpack watch only
47
+ config . files [ i ] . watched = false ;
46
48
files = [ ...files , ...glob . sync ( fileEntry . pattern ) ] ;
47
49
} ) ;
48
50
You can’t perform that action at this time.
0 commit comments