@@ -7,7 +7,7 @@ describe('DevServer', () => {
7
7
const webpack5Test = isWebpack5 ? it : it . skip ;
8
8
9
9
it ( 'should add devServer entry points to a single entry point' , ( done ) => {
10
- testBin ( '--config ./test/fixtures/dev-server/default-config.js')
10
+ testBin ( null , ' ./test/fixtures/dev-server/default-config.js')
11
11
. then ( ( output ) => {
12
12
expect ( output . exitCode ) . toEqual ( 0 ) ;
13
13
expect ( output . stdout ) . toContain ( 'client/default/index.js?' ) ;
@@ -19,9 +19,7 @@ describe('DevServer', () => {
19
19
webpack5Test (
20
20
'should add devServer entry points to a multi entry point object' ,
21
21
( done ) => {
22
- testBin (
23
- '--config ./test/fixtures/dev-server/multi-entry.js --stats=verbose'
24
- )
22
+ testBin ( '--stats=verbose' , './test/fixtures/dev-server/multi-entry.js' )
25
23
. then ( ( output ) => {
26
24
expect ( output . exitCode ) . toEqual ( 0 ) ;
27
25
expect ( output . stdout ) . toContain ( 'client/default/index.js?' ) ;
@@ -35,7 +33,7 @@ describe('DevServer', () => {
35
33
webpack5Test (
36
34
'should add devServer entry points to an empty entry object' ,
37
35
( done ) => {
38
- testBin ( '--config ./test/fixtures/dev-server/empty-entry.js')
36
+ testBin ( null , ' ./test/fixtures/dev-server/empty-entry.js')
39
37
. then ( ( output ) => {
40
38
expect ( output . exitCode ) . toEqual ( 0 ) ;
41
39
expect ( output . stdout ) . toContain ( 'client/default/index.js?' ) ;
@@ -47,7 +45,8 @@ describe('DevServer', () => {
47
45
48
46
webpack5Test ( 'should supports entry as descriptor' , ( done ) => {
49
47
testBin (
50
- '--config ./test/fixtures/entry-as-descriptor/webpack.config --stats detailed'
48
+ '--stats detailed' ,
49
+ './test/fixtures/entry-as-descriptor/webpack.config'
51
50
)
52
51
. then ( ( output ) => {
53
52
expect ( output . exitCode ) . toEqual ( 0 ) ;
@@ -58,9 +57,7 @@ describe('DevServer', () => {
58
57
} ) ;
59
58
60
59
it ( 'should only prepends devServer entry points to "web" target' , ( done ) => {
61
- testBin (
62
- '--config ./test/fixtures/dev-server/default-config.js --target web'
63
- )
60
+ testBin ( '--target web' , './test/fixtures/dev-server/default-config.js' )
64
61
. then ( ( output ) => {
65
62
expect ( output . exitCode ) . toEqual ( 0 ) ;
66
63
expect ( output . stdout ) . toContain ( 'client/default/index.js?' ) ;
@@ -71,9 +68,7 @@ describe('DevServer', () => {
71
68
} ) ;
72
69
73
70
it ( 'should not prepend devServer entry points to "node" target' , ( done ) => {
74
- testBin (
75
- '--config ./test/fixtures/dev-server/default-config.js --target node'
76
- )
71
+ testBin ( '--target node' , './test/fixtures/dev-server/default-config.js' )
77
72
. then ( ( output ) => {
78
73
expect ( output . exitCode ) . toEqual ( 0 ) ;
79
74
expect ( output . stdout ) . not . toContain ( 'client/default/index.js?' ) ;
@@ -85,7 +80,8 @@ describe('DevServer', () => {
85
80
86
81
it ( 'should prepends the hot runtime to "node" target as well' , ( done ) => {
87
82
testBin (
88
- '--config ./test/fixtures/dev-server/default-config.js --target node --hot'
83
+ '--target node --hot' ,
84
+ './test/fixtures/dev-server/default-config.js'
89
85
)
90
86
. then ( ( output ) => {
91
87
expect ( output . exitCode ) . toEqual ( 0 ) ;
@@ -112,7 +108,7 @@ describe('DevServer', () => {
112
108
} ) ;
113
109
114
110
it ( 'does not use client.path when default' , ( done ) => {
115
- testBin ( '--config ./test/fixtures/dev-server/client-default-path-config.js')
111
+ testBin ( null , ' ./test/fixtures/dev-server/client-default-path-config.js')
116
112
. then ( ( output ) => {
117
113
expect ( output . exitCode ) . toEqual ( 0 ) ;
118
114
expect ( output . stdout ) . not . toContain ( '&path=/ws' ) ;
@@ -122,7 +118,7 @@ describe('DevServer', () => {
122
118
} ) ;
123
119
124
120
it ( 'should use client.path when custom' , ( done ) => {
125
- testBin ( '--config ./test/fixtures/dev-server/client-custom-path-config.js')
121
+ testBin ( null , ' ./test/fixtures/dev-server/client-custom-path-config.js')
126
122
. then ( ( output ) => {
127
123
expect ( output . exitCode ) . toEqual ( 0 ) ;
128
124
expect ( output . stdout ) . toContain ( '&path=/custom/path' ) ;
@@ -134,7 +130,7 @@ describe('DevServer', () => {
134
130
webpack5Test (
135
131
'should prepend devServer entry points depending on targetProperties' ,
136
132
( done ) => {
137
- testBin ( '--config ./test/fixtures/dev-server/target-config.js')
133
+ testBin ( null , ' ./test/fixtures/dev-server/target-config.js')
138
134
. then ( ( output ) => {
139
135
expect ( output . exitCode ) . toEqual ( 0 ) ;
140
136
expect ( output . stdout ) . toContain ( 'client/default/index.js' ) ;
0 commit comments