Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Done
-
13.0.0
-
None
-
1
-
Puma Sprint 233
Description
When a test is failing in the ui-extension build, Jest shows a stack trace for the failing call. The line number mentioned in that stack trace is wrong. Jest seems to report the line number in the transpiled code instead of the 'real' line number in the TypeScript file. This makes it hard to pinpoint which line of code makes a test fail.
Steps to reproduce:
- Change ui-extension.ts in a way that breaks a test. For example, invert the check whether the provided callback is a function (i.e. change !== to ===)
- Run npm test
Jest will output a stack trace per failing test. For example:
at Function.Object.<anonymous>.UiExtension.register (src/ui-extension.ts:517:19) at Object.<anonymous> (src/ui-extension.spec.ts:24:17)
The reported line number (517) in ui-extension.ts is wrong (it only consists of ~65 lines). Instead, Jest should report the actual line number in the TypeScript file.