@@ -12,10 +12,7 @@ import { APPLICATION_BUILDER_INFO, BASE_OPTIONS, describeBuilder } from '../setu
12
12
describeBuilder ( buildApplication , APPLICATION_BUILDER_INFO , ( harness ) => {
13
13
describe ( 'Option: "sourceMap"' , ( ) => {
14
14
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 } ) ;
19
16
20
17
const { result } = await harness . executeOnce ( ) ;
21
18
@@ -25,10 +22,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
25
22
} ) ;
26
23
27
24
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 } ) ;
32
26
33
27
const { result } = await harness . executeOnce ( ) ;
34
28
@@ -38,10 +32,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
38
32
} ) ;
39
33
40
34
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 } } ) ;
45
36
46
37
const { result } = await harness . executeOnce ( ) ;
47
38
@@ -51,10 +42,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
51
42
} ) ;
52
43
53
44
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 } ) ;
58
46
59
47
const { result } = await harness . executeOnce ( ) ;
60
48
@@ -64,10 +52,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
64
52
} ) ;
65
53
66
54
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 } } ) ;
71
56
72
57
const { result } = await harness . executeOnce ( ) ;
73
58
@@ -79,10 +64,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
79
64
it ( 'should not include third-party sourcemaps when true' , async ( ) => {
80
65
await harness . writeFile ( 'src/polyfills.js' , `console.log('main');` ) ;
81
66
82
- harness . useTarget ( 'build' , {
83
- ...BASE_OPTIONS ,
84
- sourceMap : true ,
85
- } ) ;
67
+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : true } ) ;
86
68
87
69
const { result } = await harness . executeOnce ( ) ;
88
70
@@ -95,10 +77,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
95
77
it ( 'should not include third-party sourcemaps when vendor suboption is false' , async ( ) => {
96
78
await harness . writeFile ( 'src/polyfills.js' , `console.log('main');` ) ;
97
79
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 } } ) ;
102
81
103
82
const { result } = await harness . executeOnce ( ) ;
104
83
@@ -111,17 +90,18 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
111
90
it ( 'should include third-party sourcemaps when vendor suboption is true' , async ( ) => {
112
91
await harness . writeFile ( 'src/polyfills.js' , `console.log('main');` ) ;
113
92
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 } } ) ;
118
94
119
95
const { result } = await harness . executeOnce ( ) ;
120
96
121
97
expect ( result ?. success ) . toBe ( true ) ;
122
98
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' ) ;
125
105
} ) ;
126
106
127
107
it ( `should not include 'sourceMappingURL' sourcemaps when hidden suboption is true` , async ( ) => {
@@ -193,10 +173,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
193
173
} ) ;
194
174
195
175
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 } ) ;
200
177
201
178
const { result } = await harness . executeOnce ( ) ;
202
179
@@ -208,10 +185,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
208
185
it ( 'should generate component sourcemaps when sourcemaps when true' , async ( ) => {
209
186
await harness . writeFile ( 'src/app/app.component.css' , `* { color: red}` ) ;
210
187
211
- harness . useTarget ( 'build' , {
212
- ...BASE_OPTIONS ,
213
- sourceMap : true ,
214
- } ) ;
188
+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : true } ) ;
215
189
216
190
const { result } = await harness . executeOnce ( ) ;
217
191
@@ -226,10 +200,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
226
200
it ( 'should not generate component sourcemaps when sourcemaps when false' , async ( ) => {
227
201
await harness . writeFile ( 'src/app/app.component.css' , `* { color: red}` ) ;
228
202
229
- harness . useTarget ( 'build' , {
230
- ...BASE_OPTIONS ,
231
- sourceMap : false ,
232
- } ) ;
203
+ harness . useTarget ( 'build' , { ...BASE_OPTIONS , sourceMap : false } ) ;
233
204
234
205
const { result } = await harness . executeOnce ( ) ;
235
206
0 commit comments