Commit f871be6
fix(karma): error messages truncated due to custom formatter
Currently error messages printed out by Karma will be truncated
sometimes. This can happen for example if a jasmine test assertion
contains parenthesis characters. For example:
```ts
expect(element.style.transform).toBe('translate3d(...)')
```
If such an assertion fails, the error message from the browser
looks like that:
```
Error: Expected 'translate3d(50px, 100px, 0px)' to be 'translate3d(500px, 100px, 0px)'.
at <Jasmine>
at UserContext.eval (../../src/cdk/drag-drop/directives/drag.spec.ts:79:44 <- bin/src/cdk/drag-drop/directives/drag.spec.js:104:57)
```
Currently the format error function that is supposed to clean up paths in the error message, accidentally
matches the first path starting with `(50px, 100px, 0px` and ending with `drag.spec.ts:79:44`). Resulting in
a broken error message like:
```
Error: Expected 'translate3d(../src/cdk/drag-drop/directives/drag.spec.ts:79:44 <- bin/src/cdk/drag-drop/directives/drag.spec.js:104:57)
at UserContext.eval (external/npm/node_modules/zone.js/dist/zone-testing-bundle.js:4954:30)
at ZoneDelegate.invoke (external/npm/node_modules/zone.js/dist/zone-testing-bundle.js:391:26)
```1 parent 5551ab9 commit f871be6
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
| 421 | + | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| |||
0 commit comments