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: include rootPath of virtual folders in testPathPattern value #1080

Conversation

akwodkiewicz
Copy link
Contributor

@akwodkiewicz akwodkiewicz commented Oct 13, 2023

This PR fixes #1079 by using:

  • VirtualWorkspaceFolder.effectiveUri (including virtual's folder rootPath)

instead of:

  • VirtualWorkspaceFolder.uri (which points to the actual workspace folder)

when creating test items from folders in WorkspaceRoot

@akwodkiewicz akwodkiewicz force-pushed the fix/virtual-folder-path-patterns branch from 49bf971 to 1ab486c Compare October 13, 2023 20:12
@akwodkiewicz akwodkiewicz changed the title fix testPathPattern for virtual folders fix: include rootPath of virtual folders in testPathPattern value Oct 13, 2023
@coveralls
Copy link

coveralls commented Oct 14, 2023

Pull Request Test Coverage Report for Build 6531456082

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 97.744%

Totals Coverage Status
Change from base Build 6473195359: 0.001%
Covered Lines: 3824
Relevant Lines: 3841

💛 - Coveralls

Copy link
Collaborator

@connectdotz connectdotz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akwodkiewicz, Thanks for the PR! The change looks good, but let's create some tests to safeguard this use case.

@akwodkiewicz
Copy link
Contributor Author

Sure thing. I wanted to ask for help in how to write them, but I think I'll be able to pull off a unit test for WorkspaceRoot.createTestItem 👍

@akwodkiewicz akwodkiewicz force-pushed the fix/virtual-folder-path-patterns branch from 5079dd8 to 7c93a19 Compare October 16, 2023 09:09
@akwodkiewicz
Copy link
Contributor Author

akwodkiewicz commented Oct 17, 2023

The PR is ready for another review

Copy link
Collaborator

@connectdotz connectdotz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the tests.

@connectdotz connectdotz merged commit 1f33012 into jest-community:master Oct 22, 2023
14 checks passed
@akwodkiewicz akwodkiewicz deleted the fix/virtual-folder-path-patterns branch October 23, 2023 08:00
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.

Running tests from whole folder does not work, wrong testPathPattern option
3 participants