Skip to content
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

Load jest config from package.json if no dedicated config file found #372

Merged
merged 1 commit into from
May 4, 2023

Conversation

aj8k
Copy link
Contributor

@aj8k aj8k commented May 4, 2023

This PR fixes #228

Hi! Initially tried to fix the issue with help of updated version of c12 library #371, but it breaks build and makes PR too big. So here is a simplified version.

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
95.43% (+0.02% 🔼)
835/875
🟢 Branches
88.77% (-0.19% 🔻)
419/472
🟢 Functions 93.64% 162/173
🟢 Lines
95.06% (+0.02% 🔼)
750/789
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / parseJestConfig.ts
100%
80% (-20% 🔻)
100% 100%

Test suite run success

166 tests passing in 57 suites.

Report generated by 🧪jest coverage report action from 9c022eb

@aj8k
Copy link
Contributor Author

aj8k commented May 4, 2023

@ArtiomTr I have a question if these thresholds have any effect at all? I could see that in https://github.com/ArtiomTr/jest-coverage-report-action/blob/main/src/stages/createReport.ts that the red/yellow/green circle should come from formatCoverage function. But it takes only one number as threshold, not 4 as in jest config. And actually it is undefined in all usages of this function. And looks like the indicators always shows status comparing with default 60% coverage. Do I miss something, as actually this PR should work, it actually work but doesn't change indicator statuses based on my thresholds.

@ArtiomTr
Copy link
Owner

ArtiomTr commented May 4, 2023

Hey @aj8k 👋,

No, currently thresholds do not affect the colours of those circles. However, thresholds are a necessary part of this action, as they validate your coverage and report errors.

Fixing the colours of those circles isn't a straightforward thing to do. The fix is planned for the v3 version.

Thank you for your contribution!

@ArtiomTr ArtiomTr merged commit 9cc2b21 into ArtiomTr:main May 4, 2023
@ArtiomTr
Copy link
Owner

ArtiomTr commented May 4, 2023

@all-contributors please add @aj8k for code

@allcontributors
Copy link
Contributor

@ArtiomTr

I've put up a pull request to add @aj8k! 🎉

@ArtiomTr
Copy link
Owner

ArtiomTr commented May 4, 2023

The fix is now available under v2.2.4 or just v2 versions.

@aj8k
Copy link
Contributor Author

aj8k commented May 5, 2023

Oh, I see. Thanks for quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse threshold information from jest configuration in 'package.json'
2 participants