@@ -12,10 +12,7 @@ import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setu
1212describeBuilder ( buildApplication , APPLICATION_BUILDER_INFO , ( harness ) => {
1313 describe ( 'Option: "sourceMap"' , ( ) => {
1414 it ( 'should not generate script sourcemap files by default' , async ( ) => {
15- harness . useTarget ( 'build' , {
16- ...BASE_OPTIONS ,
17- sourceMap : undefined ,
18- } ) ;
15+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : undefined } ) ;
1916
2017 const { result } = await harness . executeOnce ( ) ;
2118
@@ -25,10 +22,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
2522 } ) ;
2623
2724 it ( 'should not generate script sourcemap files when false' , async ( ) => {
28- harness . useTarget ( 'build' , {
29- ...BASE_OPTIONS ,
30- sourceMap : false ,
31- } ) ;
25+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : false } ) ;
3226
3327 const { result } = await harness . executeOnce ( ) ;
3428
@@ -38,10 +32,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
3832 } ) ;
3933
4034 it ( 'should not generate script sourcemap files when scripts suboption is false' , async ( ) => {
41- harness . useTarget ( 'build' , {
42- ...BASE_OPTIONS ,
43- sourceMap : { scripts : false } ,
44- } ) ;
35+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : { scripts : false } } ) ;
4536
4637 const { result } = await harness . executeOnce ( ) ;
4738
@@ -51,10 +42,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
5142 } ) ;
5243
5344 it ( 'should generate script sourcemap files when true' , async ( ) => {
54- harness . useTarget ( 'build' , {
55- ...BASE_OPTIONS ,
56- sourceMap : true ,
57- } ) ;
45+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : true } ) ;
5846
5947 const { result } = await harness . executeOnce ( ) ;
6048
@@ -64,10 +52,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
6452 } ) ;
6553
6654 it ( 'should generate script sourcemap files when scripts suboption is true' , async ( ) => {
67- harness . useTarget ( 'build' , {
68- ...BASE_OPTIONS ,
69- sourceMap : { scripts : true } ,
70- } ) ;
55+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : { scripts : true } } ) ;
7156
7257 const { result } = await harness . executeOnce ( ) ;
7358
@@ -79,10 +64,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
7964 it ( 'should not include third-party sourcemaps when true' , async ( ) => {
8065 await harness . writeFile ( 'src/polyfills.js' , `console.log('main');` ) ;
8166
82- harness . useTarget ( 'build' , {
83- ...BASE_OPTIONS ,
84- sourceMap : true ,
85- } ) ;
67+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : true } ) ;
8668
8769 const { result } = await harness . executeOnce ( ) ;
8870
@@ -95,10 +77,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
9577 it ( 'should not include third-party sourcemaps when vendor suboption is false' , async ( ) => {
9678 await harness . writeFile ( 'src/polyfills.js' , `console.log('main');` ) ;
9779
98- harness . useTarget ( 'build' , {
99- ...BASE_OPTIONS ,
100- sourceMap : { scripts : true , vendor : false } ,
101- } ) ;
80+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : { scripts : true , vendor : false } } ) ;
10281
10382 const { result } = await harness . executeOnce ( ) ;
10483
@@ -111,17 +90,18 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
11190 it ( 'should include third-party sourcemaps when vendor suboption is true' , async ( ) => {
11291 await harness . writeFile ( 'src/polyfills.js' , `console.log('main');` ) ;
11392
114- harness . useTarget ( 'build' , {
115- ...BASE_OPTIONS ,
116- sourceMap : { scripts : true , vendor : true } ,
117- } ) ;
93+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : { scripts : true , vendor : true } } ) ;
11894
11995 const { result } = await harness . executeOnce ( ) ;
12096
12197 expect ( result ?. success ) . toBe ( true ) ;
12298
123- harness . expectFile ( 'dist/browser/main.js.map' ) . content . toContain ( '/core/index.ts' ) ;
124- harness . expectFile ( 'dist/browser/main.js.map' ) . content . toContain ( '/common/index.ts' ) ;
99+ harness
100+ . expectFile ( 'dist/browser/main.js.map' )
101+ . content . toContain ( '/core/src/application/application_ref.ts' ) ;
102+ harness
103+ . expectFile ( 'dist/browser/main.js.map' )
104+ . content . toContain ( '/common/src/directives/ng_if.ts' ) ;
125105 } ) ;
126106
127107 it ( `should not include 'sourceMappingURL' sourcemaps when hidden suboption is true` , async ( ) => {
@@ -193,10 +173,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
193173 } ) ;
194174
195175 it ( 'should add "x_google_ignoreList" extension to script sourcemap files when true' , async ( ) => {
196- harness . useTarget ( 'build' , {
197- ...BASE_OPTIONS ,
198- sourceMap : true ,
199- } ) ;
176+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : true } ) ;
200177
201178 const { result } = await harness . executeOnce ( ) ;
202179
@@ -208,10 +185,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
208185 it ( 'should generate component sourcemaps when sourcemaps when true' , async ( ) => {
209186 await harness . writeFile ( 'src/app/app.component.css' , `* { color: red}` ) ;
210187
211- harness . useTarget ( 'build' , {
212- ...BASE_OPTIONS ,
213- sourceMap : true ,
214- } ) ;
188+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : true } ) ;
215189
216190 const { result } = await harness . executeOnce ( ) ;
217191
@@ -226,10 +200,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
226200 it ( 'should not generate component sourcemaps when sourcemaps when false' , async ( ) => {
227201 await harness . writeFile ( 'src/app/app.component.css' , `* { color: red}` ) ;
228202
229- harness . useTarget ( 'build' , {
230- ...BASE_OPTIONS ,
231- sourceMap : false ,
232- } ) ;
203+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : false } ) ;
233204
234205 const { result } = await harness . executeOnce ( ) ;
235206
0 commit comments