Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wesleygrimes/ts-jest-coverage-incorrect-line-numbers
Reproducing bug with incorrect line numbers output from `ts-jest` with `collectCoverage: true`
https://github.com/wesleygrimes/ts-jest-coverage-incorrect-line-numbers
Last synced: 2 days ago
JSON representation
Reproducing bug with incorrect line numbers output from `ts-jest` with `collectCoverage: true`
- Host: GitHub
- URL: https://github.com/wesleygrimes/ts-jest-coverage-incorrect-line-numbers
- Owner: wesleygrimes
- Created: 2019-07-12T17:57:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T04:38:17.000Z (almost 2 years ago)
- Last Synced: 2024-10-30T10:41:20.941Z (about 2 months ago)
- Language: JavaScript
- Size: 687 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ts-jest-coverage-incorrect-line-numbers
Having an issue when running `yarn test` with `jest.config.js` `collectCoverage: true`. The line number and stack reported are incorrect.
Actual Output:
```sh
$ jest
FAIL src/foo.test.ts
✕ will it blow up? (4ms)● will it blow up?
Uh oh!
at Object.ifCalledWillBlowUp (src/foo.ts:100:9)
at Object. (src/foo.test.ts:4:3)Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 1.591s
Ran all test suites.
error Command failed with exit code 1.
```Expected Output:
```sh
$ jest
FAIL src/foo.test.ts
✕ will it blow up? (4ms)● will it blow up?
Uh oh!
1 | export function ifCalledWillBlowUp() {
> 2 | throw new Error('Uh oh!');
| ^
3 | }
4 |at Object.ifCalledWillBlowUp (src/foo.ts:2:9)
at Object. (src/foo.test.ts:4:3)Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 1.424s
Ran all test suites.
error Command failed with exit code 1.
```## Reproducing Issue
Issue can be reproduced running `yarn test` or `npm run test`
## Env Info
```json
// package.json
{
"@types/jest": "^24.0.15",
"jest": "^24.8.0",
"ts-jest": "^24.0.2",
"typescript": "^3.5.3"
}
```## Related GitHub Issues
- https://github.com/kulshekhar/ts-jest/issues/917