@@ -48,6 +48,8 @@ describe('build', () => {
48
48
runAot : true
49
49
} ;
50
50
51
+ const getBooleanPropertyValueSpy = spyOn ( helpers , helpers . getBooleanPropertyValue . name ) . and . returnValue ( true ) ;
52
+
51
53
return build . build ( context ) . then ( ( ) => {
52
54
expect ( helpers . readFileAsync ) . toHaveBeenCalled ( ) ;
53
55
expect ( copy . copy ) . toHaveBeenCalled ( ) ;
@@ -57,9 +59,11 @@ describe('build', () => {
57
59
expect ( sass . sass ) . toHaveBeenCalled ( ) ;
58
60
expect ( minify . minifyCss ) . toHaveBeenCalled ( ) ;
59
61
expect ( lint . lint ) . toHaveBeenCalled ( ) ;
62
+ expect ( getBooleanPropertyValueSpy . calls . first ( ) . args [ 0 ] ) . toEqual ( Constants . ENV_ENABLE_LINT ) ;
60
63
61
64
expect ( transpile . transpile ) . not . toHaveBeenCalled ( ) ;
62
65
} ) . catch ( err => {
66
+ console . log ( 'err: ' , err . message ) ;
63
67
expect ( true ) . toEqual ( false ) ;
64
68
} ) ;
65
69
} ) ;
@@ -73,13 +77,45 @@ describe('build', () => {
73
77
runAot : false
74
78
} ;
75
79
80
+ const getBooleanPropertyValueSpy = spyOn ( helpers , helpers . getBooleanPropertyValue . name ) . and . returnValue ( true ) ;
81
+
76
82
return build . build ( context ) . then ( ( ) => {
77
83
expect ( helpers . readFileAsync ) . toHaveBeenCalled ( ) ;
78
84
expect ( copy . copy ) . toHaveBeenCalled ( ) ;
79
85
expect ( transpile . transpile ) . toHaveBeenCalled ( ) ;
80
86
expect ( bundle . bundle ) . toHaveBeenCalled ( ) ;
81
87
expect ( sass . sass ) . toHaveBeenCalled ( ) ;
82
88
expect ( lint . lint ) . toHaveBeenCalled ( ) ;
89
+ expect ( getBooleanPropertyValueSpy . calls . first ( ) . args [ 0 ] ) . toEqual ( Constants . ENV_ENABLE_LINT ) ;
90
+ expect ( postprocess . postprocess ) . toHaveBeenCalled ( ) ;
91
+ expect ( preprocess . preprocess ) . toHaveBeenCalled ( ) ;
92
+ expect ( ngc . ngc ) . not . toHaveBeenCalled ( ) ;
93
+ expect ( minify . minifyJs ) . not . toHaveBeenCalled ( ) ;
94
+ expect ( minify . minifyCss ) . not . toHaveBeenCalled ( ) ;
95
+ } ) . catch ( err => {
96
+ expect ( true ) . toEqual ( false ) ;
97
+ } ) ;
98
+ } ) ;
99
+
100
+ it ( 'should skip lint' , ( ) => {
101
+ let context : BuildContext = {
102
+ isProd : false ,
103
+ optimizeJs : false ,
104
+ runMinifyJs : false ,
105
+ runMinifyCss : false ,
106
+ runAot : false
107
+ } ;
108
+
109
+ const getBooleanPropertyValueSpy = spyOn ( helpers , helpers . getBooleanPropertyValue . name ) . and . returnValue ( false ) ;
110
+
111
+ return build . build ( context ) . then ( ( ) => {
112
+ expect ( helpers . readFileAsync ) . toHaveBeenCalled ( ) ;
113
+ expect ( copy . copy ) . toHaveBeenCalled ( ) ;
114
+ expect ( transpile . transpile ) . toHaveBeenCalled ( ) ;
115
+ expect ( bundle . bundle ) . toHaveBeenCalled ( ) ;
116
+ expect ( sass . sass ) . toHaveBeenCalled ( ) ;
117
+ expect ( lint . lint ) . not . toHaveBeenCalled ( ) ;
118
+ expect ( getBooleanPropertyValueSpy . calls . first ( ) . args [ 0 ] ) . toEqual ( Constants . ENV_ENABLE_LINT ) ;
83
119
expect ( postprocess . postprocess ) . toHaveBeenCalled ( ) ;
84
120
expect ( preprocess . preprocess ) . toHaveBeenCalled ( ) ;
85
121
expect ( ngc . ngc ) . not . toHaveBeenCalled ( ) ;
0 commit comments