Skip to content

Commit 45155dc

Browse files
filipesilvavikerman
authored andcommitted
test: fix external source map test for Ivy
1 parent 605085c commit 45155dc

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/angular_devkit/build_angular/test/browser/vendor-source-map_spec_large.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { Architect } from '@angular-devkit/architect';
99
import * as path from 'path';
1010
import { browserBuild, createArchitect, host, veEnabled } from '../utils';
1111

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', () => {
1413
const target = { project: 'app', target: 'build' };
1514
let architect: Architect;
1615

@@ -30,8 +29,9 @@ import { browserBuild, createArchitect, host, veEnabled } from '../utils';
3029
};
3130

3231
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`);
3535
});
3636

3737
it(`works when using deprecated 'vendorSourceMap'`, async () => {
@@ -44,8 +44,9 @@ import { browserBuild, createArchitect, host, veEnabled } from '../utils';
4444
};
4545

4646
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`);
4950
});
5051

5152
it('does not map sourcemaps from external library when disabled', async () => {
@@ -58,7 +59,8 @@ import { browserBuild, createArchitect, host, veEnabled } from '../utils';
5859
};
5960

6061
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`);
6365
});
6466
});

0 commit comments

Comments
 (0)