@@ -193,6 +193,60 @@ describe("client option", () => {
193
193
} ) ;
194
194
} ) ;
195
195
196
+ describe ( "override client entry" , ( ) => {
197
+ let compiler ;
198
+ let server ;
199
+ let page ;
200
+ let browser ;
201
+
202
+ class OverrideServer extends Server {
203
+ // eslint-disable-next-line class-methods-use-this
204
+ getClientEntry ( ) {
205
+ return require . resolve (
206
+ "../fixtures/custom-client/CustomClientEntry.js" ,
207
+ ) ;
208
+ }
209
+ // eslint-disable-next-line class-methods-use-this
210
+ getClientHotEntry ( ) {
211
+ return require . resolve (
212
+ "../fixtures/custom-client/CustomClientHotEntry.js" ,
213
+ ) ;
214
+ }
215
+ }
216
+
217
+ beforeEach ( async ( ) => {
218
+ compiler = webpack ( config ) ;
219
+
220
+ server = new OverrideServer (
221
+ {
222
+ port,
223
+ } ,
224
+ compiler ,
225
+ ) ;
226
+
227
+ await server . start ( ) ;
228
+
229
+ ( { page, browser } = await runBrowser ( ) ) ;
230
+ } ) ;
231
+
232
+ afterEach ( async ( ) => {
233
+ await browser . close ( ) ;
234
+ await server . stop ( ) ;
235
+ } ) ;
236
+
237
+ it ( "should disable client entry" , async ( ) => {
238
+ const response = await page . goto ( `http://127.0.0.1:${ port } /main.js` , {
239
+ waitUntil : "networkidle0" ,
240
+ } ) ;
241
+
242
+ expect ( response . status ( ) ) . toMatchSnapshot ( "response status" ) ;
243
+
244
+ const content = await response . text ( ) ;
245
+ expect ( content ) . toContain ( "CustomClientEntry.js" ) ;
246
+ expect ( content ) . toContain ( "CustomClientHotEntry.js" ) ;
247
+ } ) ;
248
+ } ) ;
249
+
196
250
describe ( "webSocketTransport" , ( ) => {
197
251
const clientModes = [
198
252
{
0 commit comments