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

Add a trailing slash to the root pattern #5464

Merged
merged 1 commit into from
Feb 5, 2018
Merged

Add a trailing slash to the root pattern #5464

merged 1 commit into from
Feb 5, 2018

Conversation

mjesun
Copy link
Contributor

@mjesun mjesun commented Feb 5, 2018

When verifying if a test belongs to a particular project, the root of the project is part of the checks we perform (roots is checked against the filename via a regular expression). However, the regular expression did not include a trailing slash (either / or \ for Windows), which causes to wrongly recognize tests as part of a pattern. For instance:

  • Root A: /foo/bar/folder.
  • Root B: /foo/bar/folder-with-something.

All tests inside B are executed also through config A, since B starts with A. This leads to tests getting executed twice if not crashing. Adding a trailing slash fixes the problem.

@codecov-io
Copy link

Codecov Report

Merging #5464 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5464      +/-   ##
==========================================
+ Coverage   62.19%   62.22%   +0.02%     
==========================================
  Files         205      205              
  Lines        6930     6930              
  Branches        3        3              
==========================================
+ Hits         4310     4312       +2     
+ Misses       2619     2617       -2     
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-cli/src/search_source.js 40% <100%> (+2.35%) ⬆️

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 a24204a...6d90482. Read the comment docs.

@mjesun mjesun merged commit af09be8 into jestjs:master Feb 5, 2018
@mjesun mjesun deleted the fix-root-pattern branch February 5, 2018 14:16
@SimenB
Copy link
Member

SimenB commented Feb 5, 2018

changelog

@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 May 12, 2021
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