-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts-jest version 26.4.2 broke coverage #2060
Comments
Hi, would you please provide a repo to reproduce the issue ? |
Sure. https://github.com/ygortgaleno/bossabox-backend/tree/ts-jest-coverage-broken |
@ahnpnl - I have a project where the change from 26.4.1 to 26.4.2 breaks the tests because 26.4.2 is not "finding" ambient types. i.e. I have types declared in modules without export and those are (obviously) ambient types and 26.4.2 is not picking them up. This PR has the errors: https://github.com/guyellis/plant/pull/4180 I think that this is the same problem that the OP has mentioned. If it's different I'm happy to open a different issue. |
@ygortgaleno I have checked out your project but I see coverage works for me on the branch @guyellis I think your issue is a different one, but I know what causes the issue. |
@ahnpnl - would you like me to open a new issue or will you take it from here? |
yes, I think it's better to have a new issue. Your issue is about ambient types. |
Tracking Ambient Type issue here. |
@ahnpnl @ygortgaleno For a repro, you can refer to 1 of my open source lib Slickgrid-Universal So this issue is valid and should be reopened, it is a regression on my side (I actually have 2 open source libs that encountered the exact same problem). |
hi @ghiscoding , I've checked out your repo but I don't know what are the steps to reproduce. Would you please give some instructions ? |
@ahnpnl you can run, change -----------------------------------------|---------|----------|---------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------------------------------------|---------|----------|---------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
All files | 100 | 86.68 | 100 | 100 |
common/src | 100 | 100 | 100 | 100 |
... bunch of files
...
Test Suites: 174 passed, 174 total
Tests: 1 skipped, 2891 passed, 2892 total Does that help? |
I'm working on a branch (not pushed) which I have updated to the following "devDependencies": {
"@types/jest": "^26.0.15",
"jest": "^26.6.1",
"jest-cli": "^26.6.1",
"jest-environment-jsdom": "^26.6.1",
"jest-extended": "^0.11.5",
"jest-junit": "^12.0.0",
"ts-jest": "^26.4.2" and I don't see anything showing up in the Coverage, while going back to |
would you please push that branch ? |
Ok sure, here's the PR of the new branch, do you want me to merge it? It's missing the unit tests, but I can add them later if you want it merged. CircleCI is running now, I'll get the result in few minutes, I just went back to I'll report back once CircleCI is over CircleCI shows all coverage... wth??? |
I cannot reproduce either. My local shows exactly like your CI |
I have 2 other small changes in webpack config, let me undo them and see if that makes a difference.... nope still the same I don't see the full result. I don't understand... let me delete my |
@ahnpnl However I see 1 difference in the "@jest/create-cache-key-function@^26.5.0":
version "26.5.0"
resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-26.5.0.tgz#1d07947adc51ea17766d9f0ccf5a8d6ea94c47dc"
integrity sha512-DJ+pEBUIqarrbv1W/C39f9YH0rJ4wsXZ/VC6JafJPlHW2HOucKceeaqTOQj9MEDQZjySxMLkOq5mfXZXNZcmWw==
ts-jest@^26.4.2:
version "26.4.2"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.2.tgz#00b6c970bee202ceef7c6e6e9805c4837b22dab8"
integrity sha512-0+MynTTzzbuy5rGjzsCKjxHJk5gY906c/FSaqQ3081+G7dp2Yygfa9hVlbrtNNcztffh1mC6Rs9jb/yHpcjsoQ==
dependencies:
"@jest/create-cache-key-function" "^26.5.0"
... Going back to I'm on Windows 10 with NodeJS |
yes that is expected. I just published 26.4.3-beta.0 at tag next. You can also try with this next tag. |
I am using Mac. Is your issue about missing coverage of files or the coverage is not correct ? Maybe try to clear jest cache and rerun ? |
@ahnpnl I think installed
I'm expecting a full test coverage report of all files, I typically run this every time I'm adding new features so that I can see which lines are missing unit tests. However the latest version was only show 1 or 2 files of coverage, not the entire hundred files which was totally unexpected. So it looks like I'm back in business, even if I find that strange since I had the same issues on 2 different computers with 2 different projects. Also I must say, thanks a ton for your quick response, it helps a lot. ohh I just noticed you already pushed a new version |
🐛 Bug Report
Upgrading ts-jest to 26.4.2 broke the coverage files using default coverage provider(babel).
jest.config.js
Downgrading ts-jest to 26.4.1 solves the issue.
To Reproduce
Run jest with coverage option with default coverage provider.
or
Expected behavior
Show files coverage.
Debug log:
The text was updated successfully, but these errors were encountered: