-
-
Notifications
You must be signed in to change notification settings - Fork 17
feat: support rstest init command
#841
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
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
3732d08 to
c3f3066
Compare
There was a problem hiding this 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 an rstest init browser command to scaffold browser testing configuration and example files. The command supports both interactive and non-interactive modes (with --yes flag), auto-detects project settings like framework (React), language (TypeScript/JavaScript), and package manager, then generates appropriate configuration, component, and test files.
Key changes:
- Add interactive CLI initialization with project auto-detection
- Generate browser test configuration and example files
- Automatically update package.json with test scripts and dependencies
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Add new dependencies for CLI prompts and package manager detection |
| packages/core/src/core/browserLoader.ts | Remove duplicate RSTEST_VERSION declaration (now in env.d.ts) |
| packages/core/src/cli/init/browser/utils.ts | Add utility functions for file operations and package.json updates |
| packages/core/src/cli/init/browser/templates.ts | Add template generators for config, components, and tests |
| packages/core/src/cli/init/browser/index.ts | Export create function for browser initialization |
| packages/core/src/cli/init/browser/detect.ts | Add project detection logic for framework, language, and package manager |
| packages/core/src/cli/init/browser/create.ts | Implement main initialization logic with interactive and non-interactive modes |
| packages/core/src/cli/commands.ts | Register 'init' command with browser subcommand |
| packages/core/package.json | Add new dependencies for CLI functionality |
| packages/core/LICENSE.md | Add license notices for new dependencies |
| package.json | Add Playwright to root dev dependencies |
| e2e/cli/initBrowser.test.ts | Add e2e test for init browser command |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
22805ec to
68274ee
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
rstest init browsercommand with interactive and--yesmodesrstest.browser.config.ts, example component and test filespackage.jsonwithtest:browserscript and devDependenciesRelated Links
Checklist