Skip to content

feat: support filter by filename regex pattern via p shortcut#470

Merged
9aoy merged 4 commits intomainfrom
runWithFileFilters
Aug 13, 2025
Merged

feat: support filter by filename regex pattern via p shortcut#470
9aoy merged 4 commits intomainfrom
runWithFileFilters

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Aug 13, 2025

Summary

support filter by filename regex pattern via p shortcut.

image image

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings August 13, 2025 05:48
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 13, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit bf5d1ee
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/689c2886f891eb000839dc9c
😎 Deploy Preview https://deploy-preview-470--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for filtering test files by filename using regex patterns via a new p keyboard shortcut in the CLI. This feature complements the existing test name pattern filtering (t shortcut) by allowing users to narrow down which test files are included in the test run.

  • Adds fileFilters property to RstestContext for storing filename filter patterns
  • Implements runWithFileFilters function to handle file filtering during watch mode
  • Introduces new p shortcut for entering filename regex patterns in the CLI

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/core/src/types/core.ts Adds optional fileFilters property to RstestContext type
packages/core/src/core/context.ts Updates context creation to accept and store fileFilters
packages/core/src/core/index.ts Passes fileFilters from CLI arguments to context creation
packages/core/src/core/runTests.ts Implements file filtering logic and runWithFileFilters function
packages/core/src/core/listTests.ts Updates to use fileFilters from context instead of parameter
packages/core/src/core/cliShortcuts.ts Adds p shortcut and refactors input prompting logic
website/docs/en/guide/basic/cli.mdx Documents the new p shortcut in English documentation
website/docs/zh/guide/basic/cli.mdx Documents the new p shortcut in Chinese documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

9aoy and others added 2 commits August 13, 2025 13:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@9aoy 9aoy merged commit dcf9169 into main Aug 13, 2025
16 checks passed
@9aoy 9aoy deleted the runWithFileFilters branch August 13, 2025 08:07
@9aoy 9aoy mentioned this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants