File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed
packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs
tests/legacy-cli/e2e/tests/test Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ export function getTestConfig(
6060 const { styles, scripts } = wco . buildOptions . sourceMap ;
6161
6262 extraPlugins . push ( getSourceMapDevTool (
63- styles ,
64- scripts ,
63+ scripts || false ,
64+ styles || false ,
6565 false ,
6666 true ,
6767 ) ) ;
Original file line number Diff line number Diff line change 1+ import { writeFile } from '../../utils/fs' ;
2+ import { execAndWaitForOutputToMatch , killAllProcesses } from '../../utils/process' ;
3+ import { updateJsonFile } from '../../utils/project' ;
4+
5+ export default async function ( ) {
6+ await updateJsonFile ( 'angular.json' , configJson => {
7+ const appArchitect = configJson . projects [ 'test-project' ] . architect ;
8+ appArchitect . test . options . sourceMap = {
9+ scripts : true ,
10+ } ;
11+ } ) ;
12+
13+ await writeFile ( 'src/app/app.component.spec.ts' , `
14+ it('show fail', () => {
15+ expect(undefined).toBeTruthy();
16+ });
17+ ` ) ;
18+
19+ // when sourcemaps are not working the stacktrace won't point to the spec.ts file.
20+ try {
21+ await execAndWaitForOutputToMatch (
22+ 'ng' ,
23+ [ 'test' , '--watch' , 'false' ] ,
24+ / a p p \. c o m p o n e n t \. s p e c \. t s / ,
25+ ) ;
26+ } finally {
27+ killAllProcesses ( ) ;
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments