Skip to content

refactor!: enable run mode by default when run rstest command#448

Merged
chenjiahan merged 1 commit intomainfrom
watch-options
Aug 6, 2025
Merged

refactor!: enable run mode by default when run rstest command#448
chenjiahan merged 1 commit intomainfrom
watch-options

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Aug 6, 2025

Summary

Enable run mode by default when run rstest command, rather than watch mode. This is more in line with the development habits and testing framework usage of most people.

If you want to automatically rerun the test when the file changes, you can use the --watch flag or rstest watch command:

- npx rstest
+ npx rstest --watch

Checklist

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

Copilot AI review requested due to automatic review settings August 6, 2025 07:04
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 6, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 00049bd
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/6892fe987e8be20008d31aba
😎 Deploy Preview https://deploy-preview-448--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 changes the default behavior of the rstest command from automatically enabling watch mode in development environments to running tests once by default. Users must now explicitly use the --watch flag or rstest watch command to enable watch mode.

  • Removes automatic detection of CI/development environments for mode selection
  • Adds --watch flag to the main rstest command
  • Updates documentation to reflect the new default behavior and watch mode usage

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/docs/zh/guide/basic/cli.mdx Updates Chinese documentation to reflect new default behavior and adds watch mode section
website/docs/en/guide/basic/cli.mdx Updates English documentation to reflect new default behavior and adds watch mode section
packages/core/src/cli/commands.ts Implements the CLI logic change, removing CI detection and adding --watch option
packages/core/package.json Updates test script to use new default behavior
package.json Updates test script to use new default behavior
examples/react/package.json Updates test scripts to reflect new behavior patterns
examples/node/package.json Updates test scripts to reflect new behavior patterns

@9aoy 9aoy requested a review from chenjiahan August 6, 2025 07:21
@chenjiahan chenjiahan merged commit 58bf040 into main Aug 6, 2025
17 checks passed
@chenjiahan chenjiahan deleted the watch-options branch August 6, 2025 07:53
@chenjiahan
Copy link
Copy Markdown
Member

We can also consider supporting rstest watch, which is shorter than rstest --watch

@9aoy 9aoy mentioned this pull request Aug 6, 2025
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.

3 participants