Comments (7)
I've been trying to wrap my head around the current status of this, and I thought it'd be a good idea to jot down my current conclusions (both to inform others, and to double-check any incorrect assumptions I've made).
So, as far as I can tell, it is currently impossible for ts-jest to tell Jest what the correct coverage is (although it can output the correct coverage to the developer, [currently])(#61) in the remapped
directory inside the coverage directory configured for Jest).
However, a PR has been accepted into Jest that should make this possible in the future. If the developer enables the mapCoverage
option, then from Jest 20 onwards (we're at version 19 at the time of writing), ts-jest and other preprocessors should be able to report the actual coverage back to Jest. Or at least, the actual coverage as far as the source maps are accurate, which should be fine most of the time.
So for now, we'll have to wait for Jest 20, after which ts-jest can be extended to report the coverage back to Jest.
As a workaround until that time, I've created a small CLI-tool that you can point at your remapped coverage report to pass or fail a CI build depending on whether thresholds are met.
from ts-jest.
refer #42 (comment) .
from ts-jest.
Thanks for the update on this issue @kulshekhar
from ts-jest.
Thanks for the quick response. Sorry for the repeat question.
from ts-jest.
Thanks for the update and work around, much appreciated.
from ts-jest.
Coverage is no longer handled by ts-jest (see #200)
If this issue isn't addressed AND if you think the fix needs to be in ts-jest, feel free to either open a new issue or leave a comment here to reopen this.
from ts-jest.
Unfortunately it does not work at the moment: #211
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.