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:Added allowing for tests in node modules #12280

Closed
wants to merge 1 commit into from
Closed

fix:Added allowing for tests in node modules #12280

wants to merge 1 commit into from

Conversation

Biki-das
Copy link
Contributor

In order to be able to inherit a common Jest test from an npm module, the user needs to be able to search for tests in the node_modules directory. The boolean "retainAllFiles" had been hard-coded to false, preventing this inheritance from being possible. The changes here expose the variable via the "haste" configuration property and allow the user to optionally scan the node_modules for test patterns.

$ npx jest --testRegex "/*(.pact.test.js)" --runInBand
 PASS  test/src/Health.pact.test.js (9.646 s)
 PASS  node_modules/@aw/node-testing/dist/test/health.pact.test.js (5.922 s)

Test Suites: 2 passed, 2 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        15.733 s
Ran all test suites.

@codecov-commenter
Copy link

Codecov Report

Merging #12280 (a08ff4b) into main (4f4be57) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12280   +/-   ##
=======================================
  Coverage   67.52%   67.52%           
=======================================
  Files         328      328           
  Lines       17244    17244           
  Branches     5069     5069           
=======================================
  Hits        11644    11644           
  Misses       5567     5567           
  Partials       33       33           
Impacted Files Coverage Δ
packages/jest-config/src/ValidConfig.ts 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f4be57...a08ff4b. Read the comment docs.

@Biki-das
Copy link
Contributor Author

Biki-das commented Feb 2, 2022

@mrazauskas does this make sense to you?

@mrazauskas
Copy link
Contributor

Not sure I can tell something useful, because I don’t know jest-haste-map at all. On surface this feels like an overlap with testPathIgnorePatterns configuration option, but that might be wrong impression.

@Biki-das
Copy link
Contributor Author

@SimenB review

@SimenB
Copy link
Member

SimenB commented Feb 21, 2022

Duplicate of #11084

@SimenB SimenB marked this as a duplicate of #11084 Feb 21, 2022
@SimenB SimenB closed this Feb 21, 2022
@Biki-das Biki-das deleted the config-change branch February 21, 2022 13:08
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants