You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When "ng test" is used and either an uncaught error or console.log occurs outside of a test file (exp: in a component file) - the line numbers do not use sourceMaps
Current Behavior
The line number of uncaught errors and console logs are a hundred or more lines off.
Failure Information (for bugs)
It looks like "ng test" isn't loading source map files.
Steps to Reproduce
run command:
npx --ignore-existing create-nx-workspace nx-dev-test
run command:
cd nx-dev-test
run command:
ng add @nrwl/angular --defaults
run command:
ng g @nrwl/angular:application quicky
In app.component.ts - add the following (to your class):
foo():void{
throw new Error('test');
}
In app.component.spec.ts add a new unit test to call your new function:
it('check line number for crash', () => {
const appComponent:AppComponent = new AppComponent();
appComponent.foo();
});
run command:
ng test
Note that the line number is off by over a hundred - example:
at AppComponent.foo (src/app/app.component.ts:196:11)
Context
Please provide any relevant information about your setup:
test
at AppComponent.foo (src/app/app.component.ts:211:11)
at src/app/app.component.spec.ts:34:20
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/dist/zone.js:391:26)
at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../node_modules/zone.js/dist/proxy.js:129:39)
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/dist/zone.js:390:52)
at Zone.Object.<anonymous>.Zone.run (../../node_modules/zone.js/dist/zone.js:150:43)
at Object.<anonymous> (../../node_modules/jest-preset-angular/zone-patch/index.js:52:27)
Other
The text was updated successfully, but these errors were encountered:
Narrowed this down to an issue with setting collectCoverage: true in jest.config.js. If flipped to false correct line number is reported. Digging further to resolve.
Expected Behavior
When "ng test" is used and either an uncaught error or console.log occurs outside of a test file (exp: in a component file) - the line numbers do not use sourceMaps
Current Behavior
The line number of uncaught errors and console logs are a hundred or more lines off.
Failure Information (for bugs)
It looks like "ng test" isn't loading source map files.
Steps to Reproduce
run command:
npx --ignore-existing create-nx-workspace nx-dev-test
run command:
cd nx-dev-test
run command:
ng add @nrwl/angular --defaults
run command:
ng g @nrwl/angular:application quicky
In app.component.ts - add the following (to your class):
foo():void{
throw new Error('test');
}
In app.component.spec.ts add a new unit test to call your new function:
it('check line number for crash', () => {
const appComponent:AppComponent = new AppComponent();
appComponent.foo();
});
run command:
ng test
Note that the line number is off by over a hundred - example:
at AppComponent.foo (src/app/app.component.ts:196:11)
Context
Please provide any relevant information about your setup:
npx: 6.9.0
"@angular/cli": "8.0.0"
angular.json: default file generated using steps provided
"@angular-devkit/build-angular": "^0.800.0",
Failure Logs
● AppComponent › check line number for crash
Other
The text was updated successfully, but these errors were encountered: