@@ -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,30 +31,20 @@ runCLITest('CLI', () => {
40
31
} ) ;
41
32
42
33
webpack5Test ( '--hot webpack 5' , ( done ) => {
43
- testBin (
44
- '--hot' ,
45
- path . resolve ( __dirname , '../fixtures/cli/verbose-config.js' )
46
- )
34
+ testBin ( '--hot' , path . resolve ( __dirname , '../fixtures/cli/verbose-config.js' ) )
47
35
. then ( ( output ) => {
48
36
expect ( output . exitCode ) . toEqual ( 0 ) ;
49
- expect ( output . stderr ) . toContain (
50
- 'webpack/runtime/hot module replacement'
51
- ) ;
37
+ expect ( output . stderr ) . toContain ( 'webpack/runtime/hot module replacement' ) ;
52
38
done ( ) ;
53
39
} )
54
40
. catch ( done ) ;
55
41
} ) ;
56
42
57
43
webpack5Test ( '--no-hot webpack 5' , ( done ) => {
58
- testBin (
59
- '--no-hot' ,
60
- path . resolve ( __dirname , '../fixtures/cli/verbose-config.js' )
61
- )
44
+ testBin ( '--no-hot' , path . resolve ( __dirname , '../fixtures/cli/verbose-config.js' ) )
62
45
. then ( ( output ) => {
63
46
expect ( output . exitCode ) . toEqual ( 0 ) ;
64
- expect ( output . stderr ) . not . toContain (
65
- 'webpack/runtime/hot module replacement'
66
- ) ;
47
+ expect ( output . stderr ) . not . toContain ( 'webpack/runtime/hot module replacement' ) ;
67
48
done ( ) ;
68
49
} )
69
50
. catch ( done ) ;
0 commit comments