@@ -6,16 +6,7 @@ const internalIp = require('internal-ip');
6
6
const testBin = require ( '../helpers/test-bin' ) ;
7
7
const isWebpack5 = require ( '../helpers/isWebpack5' ) ;
8
8
9
- // skip if webpack-dev-server is not linked
10
- let runCLITest = describe ;
11
-
12
- try {
13
- basePath = path . join ( require . resolve ( 'webpack-dev-server' ) , '..' , '..' ) ;
14
- } catch {
15
- runCLITest = describe . skip ;
16
- }
17
-
18
- runCLITest ( 'CLI' , ( ) => {
9
+ describe ( 'CLI' , ( ) => {
19
10
const webpack4Test = isWebpack5 ? it . skip : it ;
20
11
const webpack5Test = isWebpack5 ? it : it . skip ;
21
12
@@ -40,20 +31,30 @@ runCLITest('CLI', () => {
40
31
} ) ;
41
32
42
33
webpack5Test ( '--hot webpack 5' , ( done ) => {
43
- testBin ( '--hot' , path . resolve ( __dirname , '../fixtures/cli/verbose-config.js' ) )
34
+ testBin (
35
+ '--hot' ,
36
+ path . resolve ( __dirname , '../fixtures/cli/verbose-config.js' )
37
+ )
44
38
. then ( ( output ) => {
45
39
expect ( output . exitCode ) . toEqual ( 0 ) ;
46
- expect ( output . stderr ) . toContain ( 'webpack/runtime/hot module replacement' ) ;
40
+ expect ( output . stderr ) . toContain (
41
+ 'webpack/runtime/hot module replacement'
42
+ ) ;
47
43
done ( ) ;
48
44
} )
49
45
. catch ( done ) ;
50
46
} ) ;
51
47
52
48
webpack5Test ( '--no-hot webpack 5' , ( done ) => {
53
- testBin ( '--no-hot' , path . resolve ( __dirname , '../fixtures/cli/verbose-config.js' ) )
49
+ testBin (
50
+ '--no-hot' ,
51
+ path . resolve ( __dirname , '../fixtures/cli/verbose-config.js' )
52
+ )
54
53
. then ( ( output ) => {
55
54
expect ( output . exitCode ) . toEqual ( 0 ) ;
56
- expect ( output . stderr ) . not . toContain ( 'webpack/runtime/hot module replacement' ) ;
55
+ expect ( output . stderr ) . not . toContain (
56
+ 'webpack/runtime/hot module replacement'
57
+ ) ;
57
58
done ( ) ;
58
59
} )
59
60
. catch ( done ) ;
0 commit comments