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

fix(config): resolve <rootDir> to . in coverageDirectory #26

Merged
merged 5 commits into from
Aug 26, 2024

Conversation

anlesk
Copy link
Contributor

@anlesk anlesk commented Jul 30, 2024

Jest allows root directory <rootDir> string token to be specified for path configurations.
This fix allows this variable to be resolved into path.dirname(configPath).

Fixes #22

lib/getData.js Outdated Show resolved Hide resolved
@anlesk
Copy link
Contributor Author

anlesk commented Aug 21, 2024

@rbardini kindly review / approve the workflow run.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@7671d61). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             main       #26   +/-   ##
========================================
  Coverage        ?   100.00%           
========================================
  Files           ?         7           
  Lines           ?        71           
  Branches        ?         0           
========================================
  Hits            ?        71           
  Misses          ?         0           
  Partials        ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rbardini rbardini changed the title fix: normalize coverage directory fix(config): resolve <rootDir> to . in coverageDirectory Aug 26, 2024
@rbardini rbardini merged commit e918e9e into rbardini:main Aug 26, 2024
3 checks passed
Copy link

🎉 This issue has been resolved in version 4.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rbardini
Copy link
Owner

Thanks for the fix, @anlesk! This solves the default use case, but eventually we should resolve <rootDir> to the rootDir option set in the Jest config, maybe using Jest's replaceRootDirInPath util.

@anlesk
Copy link
Contributor Author

anlesk commented Aug 27, 2024

@rbardini, I agree. The code assumes that root directory is where config file is located, but should take other options into account.

@anlesk anlesk deleted the patch-1 branch September 2, 2024 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minor Bug: coverageDirectory set to "<rootDir>/coverage" results in Error: ENOENT: no such file or directory
3 participants