@@ -9,7 +9,7 @@ const configEntryAsFunction = require('./../../fixtures/entry-as-function/webpac
9
9
const normalize = ( entry ) => entry . split ( path . sep ) . join ( '/' ) ;
10
10
11
11
describe ( 'addEntries util' , ( ) => {
12
- it ( 'should adds devServer entry points to a single entry point' , ( ) => {
12
+ it ( 'should add devServer entry points to a single entry point' , ( ) => {
13
13
const webpackOptions = Object . assign ( { } , config ) ;
14
14
15
15
addEntries ( webpackOptions , { } ) ;
@@ -21,7 +21,7 @@ describe('addEntries util', () => {
21
21
expect ( normalize ( webpackOptions . entry [ 1 ] ) ) . toEqual ( './foo.js' ) ;
22
22
} ) ;
23
23
24
- it ( 'should adds devServer entry points to a multi-module entry point' , ( ) => {
24
+ it ( 'should add devServer entry points to a multi-module entry point' , ( ) => {
25
25
const webpackOptions = Object . assign ( { } , config , {
26
26
entry : [ './foo.js' , './bar.js' ] ,
27
27
} ) ;
@@ -36,7 +36,7 @@ describe('addEntries util', () => {
36
36
expect ( webpackOptions . entry [ 2 ] ) . toEqual ( './bar.js' ) ;
37
37
} ) ;
38
38
39
- it ( 'should adds devServer entry points to a multi entry point object' , ( ) => {
39
+ it ( 'should add devServer entry points to a multi entry point object' , ( ) => {
40
40
const webpackOptions = Object . assign ( { } , config , {
41
41
entry : {
42
42
foo : './foo.js' ,
@@ -64,7 +64,7 @@ describe('addEntries util', () => {
64
64
expect ( webpackOptions . entry [ 1 ] ) . toEqual ( './src' ) ;
65
65
} ) ;
66
66
67
- it ( 'should preserves dynamic entry points' , async ( ) => {
67
+ it ( 'should preserve dynamic entry points' , async ( ) => {
68
68
let i = 0 ;
69
69
const webpackOptions = {
70
70
// simulate dynamic entry
@@ -92,7 +92,7 @@ describe('addEntries util', () => {
92
92
}
93
93
} ) ;
94
94
95
- it ( 'should preserves asynchronous dynamic entry points' , async ( ) => {
95
+ it ( 'should preserve asynchronous dynamic entry points' , async ( ) => {
96
96
let i = 0 ;
97
97
const webpackOptions = {
98
98
// simulate async dynamic entry
@@ -121,7 +121,7 @@ describe('addEntries util', () => {
121
121
}
122
122
} ) ;
123
123
124
- it ( "should prepends webpack's hot reload client script" , ( ) => {
124
+ it ( "should prepend webpack's hot reload client script" , ( ) => {
125
125
const webpackOptions = Object . assign ( { } , config , {
126
126
entry : {
127
127
app : './app.js' ,
@@ -138,7 +138,7 @@ describe('addEntries util', () => {
138
138
expect ( hotClientScript ) . toEqual ( require . resolve ( hotClientScript ) ) ;
139
139
} ) ;
140
140
141
- it ( "should prepends webpack's hot only client script" , ( ) => {
141
+ it ( "should prepend webpack's hot only client script" , ( ) => {
142
142
const webpackOptions = Object . assign ( { } , config , {
143
143
entry : {
144
144
app : './app.js' ,
@@ -155,23 +155,23 @@ describe('addEntries util', () => {
155
155
expect ( hotClientScript ) . toEqual ( require . resolve ( hotClientScript ) ) ;
156
156
} ) ;
157
157
158
- it ( " should doesn't add the HMR plugin if not hot and no plugins" , ( ) => {
158
+ it ( ' should not add the HMR plugin if not hot and no plugins' , ( ) => {
159
159
const webpackOptions = Object . assign ( { } , config ) ;
160
160
161
161
addEntries ( webpackOptions , { } ) ;
162
162
163
163
expect ( 'plugins' in webpackOptions ) . toBeFalsy ( ) ;
164
164
} ) ;
165
165
166
- it ( " should doesn't add the HMR plugin if not hot and empty plugins" , ( ) => {
166
+ it ( ' should not add the HMR plugin if not hot and empty plugins' , ( ) => {
167
167
const webpackOptions = Object . assign ( { } , config , { plugins : [ ] } ) ;
168
168
169
169
addEntries ( webpackOptions , { } ) ;
170
170
171
171
expect ( webpackOptions . plugins ) . toEqual ( [ ] ) ;
172
172
} ) ;
173
173
174
- it ( " should doesn't add the HMR plugin if not hot and some plugins" , ( ) => {
174
+ it ( ' should not add the HMR plugin if not hot and some plugins' , ( ) => {
175
175
const existingPlugin1 = new webpack . BannerPlugin ( 'happy birthday' ) ;
176
176
const existingPlugin2 = new webpack . DefinePlugin ( { foo : 'bar' } ) ;
177
177
const webpackOptions = Object . assign ( { } , config , {
@@ -183,7 +183,7 @@ describe('addEntries util', () => {
183
183
expect ( webpackOptions . plugins ) . toEqual ( [ existingPlugin1 , existingPlugin2 ] ) ;
184
184
} ) ;
185
185
186
- it ( 'should adds the HMR plugin if hot' , ( ) => {
186
+ it ( 'should add the HMR plugin if hot' , ( ) => {
187
187
const existingPlugin = new webpack . BannerPlugin ( 'bruce' ) ;
188
188
const webpackOptions = Object . assign ( { } , config , {
189
189
plugins : [ existingPlugin ] ,
@@ -197,7 +197,7 @@ describe('addEntries util', () => {
197
197
] ) ;
198
198
} ) ;
199
199
200
- it ( 'should adds the HMR plugin if hot-only' , ( ) => {
200
+ it ( 'should add the HMR plugin if hot-only' , ( ) => {
201
201
const webpackOptions = Object . assign ( { } , config ) ;
202
202
203
203
addEntries ( webpackOptions , { hot : 'only' } ) ;
@@ -207,7 +207,7 @@ describe('addEntries util', () => {
207
207
] ) ;
208
208
} ) ;
209
209
210
- it ( "should doesn't add the HMR plugin again if it's already there" , ( ) => {
210
+ it ( "should not add the HMR plugin again if it's already there" , ( ) => {
211
211
const existingPlugin = new webpack . BannerPlugin ( 'bruce' ) ;
212
212
const webpackOptions = Object . assign ( { } , config , {
213
213
plugins : [ new webpack . HotModuleReplacementPlugin ( ) , existingPlugin ] ,
@@ -240,7 +240,7 @@ describe('addEntries util', () => {
240
240
] ) ;
241
241
} ) ;
242
242
243
- it ( 'should can prevent duplicate entries from successive calls' , ( ) => {
243
+ it ( 'should prevent duplicate entries from successive calls' , ( ) => {
244
244
const webpackOptions = Object . assign ( { } , config ) ;
245
245
246
246
addEntries ( webpackOptions , { hot : true } ) ;
@@ -254,15 +254,15 @@ describe('addEntries util', () => {
254
254
expect ( result . length ) . toEqual ( 1 ) ;
255
255
} ) ;
256
256
257
- it ( 'should supports entry as Function' , ( ) => {
257
+ it ( 'should support entry as Function' , ( ) => {
258
258
const webpackOptions = Object . assign ( { } , configEntryAsFunction ) ;
259
259
260
260
addEntries ( webpackOptions , { } ) ;
261
261
262
262
expect ( typeof webpackOptions . entry === 'function' ) . toBe ( true ) ;
263
263
} ) ;
264
264
265
- it ( 'should only prepends devServer entry points to web targets by default' , ( ) => {
265
+ it ( 'should only prepend devServer entry points to web targets by default' , ( ) => {
266
266
const webpackOptions = [
267
267
Object . assign ( { } , config ) ,
268
268
Object . assign ( { target : 'web' } , config ) ,
@@ -292,7 +292,7 @@ describe('addEntries util', () => {
292
292
} ) ;
293
293
} ) ;
294
294
295
- it ( 'should allows selecting compilations to inline the client into' , ( ) => {
295
+ it ( 'should allow selecting compilations to inline the client into' , ( ) => {
296
296
const webpackOptions = [
297
297
Object . assign ( { } , config ) ,
298
298
Object . assign ( { target : 'web' } , config ) ,
@@ -322,7 +322,7 @@ describe('addEntries util', () => {
322
322
} ) ;
323
323
} ) ;
324
324
325
- it ( 'should prepends the hot runtime to all targets by default (when hot)' , ( ) => {
325
+ it ( 'should prepend the hot runtime to all targets by default (when hot)' , ( ) => {
326
326
const webpackOptions = [
327
327
Object . assign ( { target : 'web' } , config ) ,
328
328
Object . assign ( { target : 'node' } , config ) ,
@@ -347,7 +347,7 @@ describe('addEntries util', () => {
347
347
} ) ;
348
348
} ) ;
349
349
350
- it ( 'should allows selecting which compilations to inject the hot runtime into' , ( ) => {
350
+ it ( 'should allow selecting which compilations to inject the hot runtime into' , ( ) => {
351
351
const webpackOptions = [
352
352
Object . assign ( { target : 'web' } , config ) ,
353
353
Object . assign ( { target : 'node' } , config ) ,
@@ -359,7 +359,7 @@ describe('addEntries util', () => {
359
359
} ) ;
360
360
361
361
// node target should have the client runtime but not the hot runtime
362
- const webWebpackOptions = webpackOptions [ 0 ] ;
362
+ const [ webWebpackOptions , nodeWebpackOptions ] = webpackOptions ;
363
363
364
364
expect ( webWebpackOptions . entry . length ) . toEqual ( 2 ) ;
365
365
@@ -369,9 +369,6 @@ describe('addEntries util', () => {
369
369
370
370
expect ( normalize ( webWebpackOptions . entry [ 1 ] ) ) . toEqual ( './foo.js' ) ;
371
371
372
- // node target should have the hot runtime but not the client runtime
373
- const nodeWebpackOptions = webpackOptions [ 1 ] ;
374
-
375
372
expect ( nodeWebpackOptions . entry . length ) . toEqual ( 2 ) ;
376
373
377
374
expect (
0 commit comments