@@ -9,8 +9,7 @@ import { Architect } from '@angular-devkit/architect';
9
9
import * as path from 'path' ;
10
10
import { browserBuild , createArchitect , host , veEnabled } from '../utils' ;
11
11
12
- // DISABLED_FOR_IVY These should pass but are currently not supported
13
- ( veEnabled ? describe : xdescribe ) ( 'Browser Builder external source map' , ( ) => {
12
+ describe ( 'Browser Builder external source map' , ( ) => {
14
13
const target = { project : 'app' , target : 'build' } ;
15
14
let architect : Architect ;
16
15
@@ -30,8 +29,9 @@ import { browserBuild, createArchitect, host, veEnabled } from '../utils';
30
29
} ;
31
30
32
31
const { files } = await browserBuild ( architect , host , target , overrides ) ;
33
- const sourcePath = JSON . parse ( await files [ 'vendor.js.map' ] ) . sources [ 0 ] ;
34
- expect ( path . extname ( sourcePath ) ) . toBe ( '.ts' , `${ sourcePath } extention should be '.ts'` ) ;
32
+ const sourcePaths : string [ ] = JSON . parse ( await files [ 'vendor.js.map' ] ) . sources ;
33
+ const hasTsSourcePaths = sourcePaths . some ( p => path . extname ( p ) == '.ts' ) ;
34
+ expect ( hasTsSourcePaths ) . toBe ( true , `vendor.js.map should have '.ts' extentions` ) ;
35
35
} ) ;
36
36
37
37
it ( `works when using deprecated 'vendorSourceMap'` , async ( ) => {
@@ -44,8 +44,9 @@ import { browserBuild, createArchitect, host, veEnabled } from '../utils';
44
44
} ;
45
45
46
46
const { files } = await browserBuild ( architect , host , target , overrides ) ;
47
- const sourcePath = JSON . parse ( await files [ 'vendor.js.map' ] ) . sources [ 0 ] ;
48
- expect ( path . extname ( sourcePath ) ) . toBe ( '.ts' , `${ sourcePath } extention should be '.ts'` ) ;
47
+ const sourcePaths : string [ ] = JSON . parse ( await files [ 'vendor.js.map' ] ) . sources ;
48
+ const hasTsSourcePaths = sourcePaths . some ( p => path . extname ( p ) == '.ts' ) ;
49
+ expect ( hasTsSourcePaths ) . toBe ( true , `vendor.js.map should have '.ts' extentions` ) ;
49
50
} ) ;
50
51
51
52
it ( 'does not map sourcemaps from external library when disabled' , async ( ) => {
@@ -58,7 +59,8 @@ import { browserBuild, createArchitect, host, veEnabled } from '../utils';
58
59
} ;
59
60
60
61
const { files } = await browserBuild ( architect , host , target , overrides ) ;
61
- const sourcePath = JSON . parse ( await files [ 'vendor.js.map' ] ) . sources [ 0 ] ;
62
- expect ( path . extname ( sourcePath ) ) . toBe ( '.js' , `${ sourcePath } extention should be '.ts'` ) ;
62
+ const sourcePaths : string [ ] = JSON . parse ( await files [ 'vendor.js.map' ] ) . sources ;
63
+ const hasTsSourcePaths = sourcePaths . some ( p => path . extname ( p ) == '.ts' ) ;
64
+ expect ( hasTsSourcePaths ) . toBe ( false , `vendor.js.map not should have '.ts' extentions` ) ;
63
65
} ) ;
64
66
} ) ;
0 commit comments