2
2
3
3
const path = require ( "path" ) ;
4
4
const webpack = require ( "webpack" ) ;
5
- const { test} = require ( "@playwright/test" ) ;
5
+ const { test } = require ( "@playwright/test" ) ;
6
6
const { expect } = require ( "@playwright/test" ) ;
7
7
const { describe } = require ( "@playwright/test" ) ;
8
- const { afterEach } = require ( "@playwright/test" )
8
+ const { afterEach } = require ( "@playwright/test" ) ;
9
9
const { beforeEach } = require ( "@playwright/test" ) ;
10
10
const { jest } = require ( "@jest/globals" ) ;
11
11
// eslint-disable-next-line import/no-extraneous-dependencies
@@ -15,7 +15,7 @@ const config = require("../fixtures/client-config/webpack.config");
15
15
const sessionSubscribe = require ( "../helpers/session-subscribe" ) ;
16
16
const port = require ( "../ports-map" ) . api ;
17
17
18
- describe ( "API" , ( ) => {
18
+ describe . skip ( "API" , ( ) => {
19
19
describe ( "WEBPACK_SERVE environment variable" , ( ) => {
20
20
const OLD_ENV = process . env ;
21
21
let server ;
@@ -25,7 +25,7 @@ describe("API", () => {
25
25
beforeEach ( async ( ) => {
26
26
// this is important - it clears the cache
27
27
// jest.resetModules();
28
- Object . keys ( require . cache ) . forEach ( key => delete require . cache [ key ] ) ;
28
+ Object . keys ( require . cache ) . forEach ( ( key ) => delete require . cache [ key ] ) ;
29
29
30
30
process . env = { ...OLD_ENV } ;
31
31
@@ -66,7 +66,9 @@ describe("API", () => {
66
66
67
67
expect ( JSON . stringify ( response . status ( ) ) ) . toMatchSnapshot ( ) ;
68
68
69
- expect ( JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ) . toMatchSnapshot ( ) ;
69
+ expect (
70
+ JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ,
71
+ ) . toMatchSnapshot ( ) ;
70
72
71
73
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
72
74
} ) ;
@@ -96,7 +98,8 @@ describe("API", () => {
96
98
} ) ;
97
99
98
100
expect (
99
- JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ) . toMatchSnapshot ( ) ;
101
+ JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ,
102
+ ) . toMatchSnapshot ( ) ;
100
103
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
101
104
} catch ( error ) {
102
105
throw error ;
@@ -132,7 +135,8 @@ describe("API", () => {
132
135
} ) ;
133
136
134
137
expect (
135
- JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ) . toMatchSnapshot ( ) ;
138
+ JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ,
139
+ ) . toMatchSnapshot ( ) ;
136
140
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
137
141
} catch ( error ) {
138
142
throw error ;
@@ -212,7 +216,9 @@ describe("API", () => {
212
216
}
213
217
} ) ;
214
218
215
- test . skip ( `should work and allow to rerun dev server multiple times` , async ( { page } ) => {
219
+ test . skip ( `should work and allow to rerun dev server multiple times` , async ( {
220
+ page,
221
+ } ) => {
216
222
const compiler = webpack ( config ) ;
217
223
const server = new Server ( { port } , compiler ) ;
218
224
@@ -310,7 +316,9 @@ describe("API", () => {
310
316
await server . stop ( ) ;
311
317
} ) ;
312
318
313
- test ( "should use the default `noop` callback when invalidate is called without any callback" , async ( { page } ) => {
319
+ test ( "should use the default `noop` callback when invalidate is called without any callback" , async ( {
320
+ page,
321
+ } ) => {
314
322
const callback = jestMock . fn ( ) ;
315
323
316
324
server . invalidate ( ) ;
@@ -331,7 +339,9 @@ describe("API", () => {
331
339
expect ( callback ) . toHaveBeenCalledTimes ( 1 ) ;
332
340
expect ( JSON . stringify ( response . status ( ) ) ) . toMatchSnapshot ( ) ;
333
341
334
- expect ( JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ) . toMatchSnapshot ( ) ;
342
+ expect (
343
+ JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ,
344
+ ) . toMatchSnapshot ( ) ;
335
345
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
336
346
} ) ;
337
347
@@ -347,7 +357,9 @@ describe("API", () => {
347
357
expect ( callback ) . toHaveBeenCalledTimes ( 1 ) ;
348
358
expect ( JSON . stringify ( response . status ( ) ) ) . toMatchSnapshot ( ) ;
349
359
350
- expect ( JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ) . toMatchSnapshot ( ) ;
360
+ expect (
361
+ JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ,
362
+ ) . toMatchSnapshot ( ) ;
351
363
352
364
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
353
365
} ) ;
@@ -443,12 +455,16 @@ describe("API", () => {
443
455
444
456
expect ( JSON . stringify ( response . status ( ) ) ) . toMatchSnapshot ( ) ;
445
457
446
- expect ( JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ) . toMatchSnapshot ( ) ;
458
+ expect (
459
+ JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ,
460
+ ) . toMatchSnapshot ( ) ;
447
461
448
462
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
449
463
} ) ;
450
464
451
- test ( "should return the port when the port is undefined" , async ( { page } ) => {
465
+ test ( "should return the port when the port is undefined" , async ( {
466
+ page,
467
+ } ) => {
452
468
const retryCount = 3 ;
453
469
454
470
process . env . WEBPACK_DEV_SERVER_PORT_RETRY = retryCount ;
@@ -475,14 +491,20 @@ describe("API", () => {
475
491
waitUntil : "networkidle0" ,
476
492
} ) ;
477
493
478
- expect ( JSON . stringify ( response . status ( ) ) ) . toMatchSnapshot ( "response status" ) ;
494
+ expect ( JSON . stringify ( response . status ( ) ) ) . toMatchSnapshot (
495
+ "response status" ,
496
+ ) ;
479
497
480
- expect ( JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ) . toMatchSnapshot ( ) ;
498
+ expect (
499
+ JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ,
500
+ ) . toMatchSnapshot ( ) ;
481
501
482
502
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
483
503
} ) ;
484
504
485
- test ( "should retry finding the port for up to defaultPortRetry times (number)" , async ( { page } ) => {
505
+ test ( "should retry finding the port for up to defaultPortRetry times (number)" , async ( {
506
+ page,
507
+ } ) => {
486
508
const retryCount = 4 ;
487
509
488
510
process . env . WEBPACK_DEV_SERVER_PORT_RETRY = retryCount ;
@@ -510,12 +532,16 @@ describe("API", () => {
510
532
511
533
expect ( JSON . stringify ( response . status ( ) ) ) . toMatchSnapshot ( ) ;
512
534
513
- expect ( JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ) . toMatchSnapshot ( ) ;
535
+ expect (
536
+ JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ,
537
+ ) . toMatchSnapshot ( ) ;
514
538
515
539
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
516
540
} ) ;
517
541
518
- test ( "should retry finding the port for up to defaultPortRetry times (string)" , async ( { page } ) => {
542
+ test ( "should retry finding the port for up to defaultPortRetry times (string)" , async ( {
543
+ page,
544
+ } ) => {
519
545
const retryCount = 5 ;
520
546
521
547
process . env . WEBPACK_DEV_SERVER_PORT_RETRY = retryCount ;
@@ -541,14 +567,20 @@ describe("API", () => {
541
567
waitUntil : "networkidle0" ,
542
568
} ) ;
543
569
544
- expect ( JSON . stringify ( response . status ( ) ) ) . toMatchSnapshot ( "response status" ) ;
570
+ expect ( JSON . stringify ( response . status ( ) ) ) . toMatchSnapshot (
571
+ "response status" ,
572
+ ) ;
545
573
546
- expect ( JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ) . toMatchSnapshot ( ) ;
574
+ expect (
575
+ JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) ,
576
+ ) . toMatchSnapshot ( ) ;
547
577
548
578
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
549
579
} ) ;
550
580
551
- test ( "should retry finding the port when serial ports are busy" , async ( { page } ) => {
581
+ test ( "should retry finding the port when serial ports are busy" , async ( {
582
+ page,
583
+ } ) => {
552
584
const busyPorts = [ 60000 , 60001 , 60002 , 60003 , 60004 , 60005 ] ;
553
585
554
586
process . env . WEBPACK_DEV_SERVER_PORT_RETRY = 1000 ;
@@ -630,7 +662,9 @@ describe("API", () => {
630
662
} ) ;
631
663
} ) ;
632
664
633
- test ( 'should allow URLs with scheme for checking origin when the "option.client.webSocketURL" is object' , async ( { page } ) => {
665
+ test ( 'should allow URLs with scheme for checking origin when the "option.client.webSocketURL" is object' , async ( {
666
+ page,
667
+ } ) => {
634
668
const options = {
635
669
port,
636
670
client : {
@@ -704,7 +738,9 @@ describe("API", () => {
704
738
705
739
expect (
706
740
// net::ERR_NAME_NOT_RESOLVED can be multiple times
707
- JSON . stringify ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . slice ( 0 , 7 ) ,
741
+ JSON . stringify (
742
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
743
+ ) . slice ( 0 , 7 ) ,
708
744
) . toMatchSnapshot ( ) ;
709
745
710
746
expect ( JSON . stringify ( pageErrors ) ) . toMatchSnapshot ( ) ;
0 commit comments