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: watch mode's filename pattern to persist on unrelated file changes #2754

Merged

Conversation

AriPerkkio
Copy link
Member

This PR contains couple of fixes and features related to watch mode and filename+testname pattern filters. As each fix/feat builds on top of the other one, here is a single PR containing all. Commits are ready for rebasing (instead of squashing) as well.

  • fix: watch mode's filename pattern to persist on unrelated file changes

  • fix: watch mode's filename pattern to persist re-run of failed tests, snapshot updates and testname filter changes

    • Fixes cases where filename pattern was ignored when:
      • user pressed f to run failed test cases only
      • user pressed u to update failed snapshots
      • user pressed t to apply new testname filter
    • In all of the cases above the action was also performed against files that did not match the filename pattern
  • fix: dont incorrectly mark a run failed if filename pattern excludes previously failed tests

    • Fixes case where a test run was marked failed if previous run contained file changes, and new run contained filename pattern
    • Here is example where math.test.ts failed on earlier run, but now we are using /animal/ as test name filter
    • image
  • feat: show active filename pattern on CLI

    • Adds filename pattern to the terminal
    • See line 2 below:
    • image
  • feat: show active test name pattern on CLI

    • Adds test name pattern to the terminal
    • See line 2 below:
    • image

@AriPerkkio AriPerkkio force-pushed the fix/watch-filename-pattern-reset branch from 7084deb to 5174a4d Compare January 26, 2023 12:01
@sheremet-va sheremet-va merged commit df7c410 into vitest-dev:main Jan 27, 2023
@AriPerkkio AriPerkkio deleted the fix/watch-filename-pattern-reset branch January 27, 2023 11:39
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.

Saving file resets filename pattern in watch
2 participants