Comments (6)
Also output in console is seems to be wrong - probably we have to investigate and fix it.
: I've investigated this and currently it's not possible.
Jest writes coverage by delivering result to coverage reporter while collecting all test results. Console output for coverage happens at this time, before testresultprocessor being invoked. So its output is before-mapping, then coverage processor takes over try to remap its results.
It is because design of test result processor limitation, details at here : jestjs/jest#1907 (comment) unless there's upstream changes to have specific hooks invoked to return mutated results back to jest or change behavior of current hooks, there isn't way to achieve this.
from ts-jest.
If you want to give it a spin:
- clone repo
npm i
jest --coverage --no-cache
Coverage will be incoverage
folder found in project root.
from ts-jest.
Ok, I've found out what is wrong. Our coverage is in ./coverage/remapped
folder, not in ./coverage
and it could be confusing. Also output in console is seems to be wrong - probably we have to investigate and fix it.
from ts-jest.
By using reporters in package.json
:
"coverageReporters": [ "html", "text", "lcov", "lcovonly", "json" ],
Differences:
html
goes into./coverage/remapped/html
, original is./coverage
. The file structure is also not the same: remapped contains an additionalsrc
folder.lcov
is missing completely, original is./coverage/lcov-report
.json
goes into./coverage/remapped/coverage.json
, original is./coverage/coverage-final.json
. Filename differs.
lconvonly
seems to have right filename: ./coverage/remapped/lcov.info
, original is ./coverage/lcov.info
.
from ts-jest.
Please note coverage processor do not exactly follow configurations of jest.
html
: it's generated by remap-istanbul
via remapped source mapping. It is expected to have different structure. coverage processor does not touch folder structure other than output location.
lcov
: for some reason remap to lcov from jest's output simply doesn't work, so remapping is skipped.
Filename differs
: it is expected. Jest does not exposes which configuration they're using (for example, file name) so coverage processor does not have way to know what was original file name saved and match with it. Instead, it tries best effort to create possible coverage report with own naming https://github.com/kulshekhar/ts-jest/blob/master/src/coverageprocessor.ts#L41
from ts-jest.
Closing in favor of #101
from ts-jest.
Related Issues (20)
- [Security] Lodash vulnerability
- [Bug]: Cannot read properties of undefined while using NestJS and Enum HOT 1
- [Bug]: error TS2307: Cannot find module '...' or its corresponding type declarations. HOT 2
- [Feature]: Bump JEST to 29.7.0 HOT 3
- [Bug]: docs confusion - deprecated presets HOT 4
- [Bug]: setupFilesAfterEnv with a path to a TS file leads to the error "SyntaxError: Cannot use import statement outside a module" HOT 4
- [Bug]: ESM Support "Use ESM Presets" documentation has confusing redundancy HOT 1
- [Bug]: dynamic imports create a double default-wrapped export -- `{ default: { default: MyDefaultExport } }` HOT 2
- version 29.2.1 and 29.2.2 have new dependency on ejs which is flagged with critical CVE-2023-29827. Can this be remedied? HOT 2
- [Bug]: Using "module": "NodeNext" causes the error "SyntaxError: Cannot use import statement outside a module" HOT 5
- [Bug]: Version `29.2.1` breaks default imports HOT 2
- [Bug]: ts-jest 29.2 breaks dependency transform HOT 18
- [Please read the message below]
- [Bug]: ts-jest[cli] (FATAL) Configuration file jest.config.cjs must be a JavaScript or JSON file. with config.migrate in vite react project HOT 2
- [Please read the message below]
- [Bug]: "ReferenceError: exports is not defined" with ts-jest 29.2 HOT 2
- [Bug]: broken link in installation page in getting started
- [Bug]: When import ESModule from CommonJS, Error: Must use import to load ES Module HOT 12
- [Bug]: Undefined moduleResolution HOT 1
- [Feature]: Support tc39 import attributes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-jest.