@@ -14,7 +14,7 @@ describe('tsdx build with closure compiler', () => {
14
14
util . teardownStage ( stageName ) ;
15
15
} ) ;
16
16
17
- it ( 'should compile files with default options' , ( ) => {
17
+ it ( 'should minify bundle with default options' , ( ) => {
18
18
util . setupStageWithFixture ( stageName , 'build-withConfig' ) ;
19
19
shell . mv ( '-f' , 'tsdx.config.closure-simple.js' , 'tsdx.config.js' ) ;
20
20
@@ -36,12 +36,14 @@ describe('tsdx build with closure compiler', () => {
36
36
37
37
expect ( shell . test ( '-f' , 'dist/index.d.ts' ) ) . toBeTruthy ( ) ;
38
38
39
- output = shell . exec ( 'node dist/index.js' ) ;
40
- expect ( output . code ) . toBe ( 0 ) ;
39
+ // only closure compiler minifies bundle to `signature="bar 0"`
40
+ output = shell . grep ( 'bar 0' , [
41
+ 'dist/build-withconfig.esm.production.min.js' ,
42
+ ] ) ;
41
43
expect ( / b a r 0 / . test ( output . stdout ) ) . toBeTruthy ( ) ;
42
44
} ) ;
43
45
44
- it ( 'should compile files with advanced options' , ( ) => {
46
+ it ( 'should minify bundle with advanced options' , ( ) => {
45
47
util . setupStageWithFixture ( stageName , 'build-withConfig' ) ;
46
48
shell . mv ( '-f' , 'tsdx.config.closure-advanced.js' , 'tsdx.config.js' ) ;
47
49
@@ -50,11 +52,6 @@ describe('tsdx build with closure compiler', () => {
50
52
) ;
51
53
expect ( output . code ) . toBe ( 0 ) ;
52
54
53
- // ensure we use closure-compiler instead of terser
54
- const plugins = require ( `../../${ stageName } /plugins.json` ) ;
55
- expect ( plugins . includes ( 'closure-compiler' ) ) . toBeTruthy ( ) ;
56
- expect ( plugins . includes ( 'terser' ) ) . toBeFalsy ( ) ;
57
-
58
55
expect ( shell . test ( '-f' , 'dist/index.js' ) ) . toBeTruthy ( ) ;
59
56
expect (
60
57
shell . test ( '-f' , 'dist/build-withconfig.cjs.development.js' )
@@ -68,8 +65,10 @@ describe('tsdx build with closure compiler', () => {
68
65
69
66
expect ( shell . test ( '-f' , 'dist/index.d.ts' ) ) . toBeTruthy ( ) ;
70
67
71
- output = shell . exec ( 'node dist/index.js' ) ;
72
- expect ( output . code ) . toBe ( 0 ) ;
68
+ // only closure compiler minifies bundle to `signature="bar 0"`
69
+ output = shell . grep ( 'bar 0' , [
70
+ 'dist/build-withconfig.esm.production.min.js' ,
71
+ ] ) ;
73
72
expect ( / b a r 0 / . test ( output . stdout ) ) . toBeTruthy ( ) ;
74
73
} ) ;
75
74
0 commit comments