refactor: move Rstest examples to rstest folder#433
Merged
chenjiahan merged 2 commits intomainfrom Apr 16, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Moves Rstest-related examples under the rstest/ workspace and standardizes how the Rstest CLI is invoked across several example packages.
Changes:
- Update multiple Rstest example
package.jsontest scripts fromrstest runtorstest(and--updateaccordingly). - Add a new
rstest/rsbuild-reactexample project (config, source, tests) and rename its package scope/name. - Remove the previous
rsbuild/react-rstestandrsbuild/react-jestexample folders/files.
Reviewed changes
Copilot reviewed 23 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rstest/snapshot/package.json | Switch snapshot example scripts to rstest / rstest --update. |
| rstest/rslib-adapter/package.json | Switch test script to rstest. |
| rstest/rsbuild-svelte/package.json | Switch test script to rstest. |
| rstest/rsbuild-solid/package.json | Switch test script to rstest. |
| rstest/rsbuild-react/tsconfig.json | Add TS config for the new rsbuild+react Rstest example. |
| rstest/rsbuild-react/tests/tsconfig.json | Add test TS config and test environment type definitions. |
| rstest/rsbuild-react/tests/App.spec.tsx | Add a basic React Testing Library spec. |
| rstest/rsbuild-react/src/index.tsx | Add React app entrypoint. |
| rstest/rsbuild-react/src/env.d.ts | Add Rsbuild type references. |
| rstest/rsbuild-react/src/App.tsx | Add the example React component (imports CSS). |
| rstest/rsbuild-react/src/App.css | Add basic styling for the example app. |
| rstest/rsbuild-react/rstest.setup.ts | Add RTL jest-dom setup import. |
| rstest/rsbuild-react/rstest.config.ts | Add Rstest configuration for the example (currently Rsbuild integration approach differs from other examples). |
| rstest/rsbuild-react/rsbuild.config.ts | Add Rsbuild configuration for the example. |
| rstest/rsbuild-react/package.json | Rename package to @rstest-example/rsbuild-react and switch test script to rstest. |
| rstest/rsbuild-react/README.md | Add usage/readme for the new example. |
| rstest/rsbuild-react/.gitignore | Add ignores for the new example. |
| rstest/rsbuild-preact/package.json | Switch test script to rstest. |
| rstest/rsbuild-adapter/package.json | Switch test script to rstest. |
| rstest/mocking/package.json | Switch test script to rstest. |
| rstest/fake-timers/package.json | Switch test script to rstest. |
| rsbuild/react-rstest/tsconfig.json | Remove old rsbuild react-rstest example file. |
| rsbuild/react-rstest/tests/App.spec.tsx | Remove old rsbuild react-rstest example test. |
| rsbuild/react-rstest/src/index.tsx | Remove old rsbuild react-rstest example entrypoint. |
| rsbuild/react-rstest/src/env.d.ts | Remove old rsbuild react-rstest example env types. |
| rsbuild/react-rstest/src/App.tsx | Remove old rsbuild react-rstest example component. |
| rsbuild/react-rstest/src/App.css | Remove old rsbuild react-rstest example CSS. |
| rsbuild/react-rstest/rsbuild.config.ts | Remove old rsbuild react-rstest example config. |
| rsbuild/react-rstest/.gitignore | Remove old rsbuild react-rstest example gitignore. |
| rsbuild/react-jest/tests/tsconfig.json | Remove old rsbuild react-jest example test TS config. |
| rsbuild/react-jest/tests/mocks/styleMock.js | Remove Jest CSS mock. |
| rsbuild/react-jest/tests/mocks/fileMock.js | Remove Jest asset mock. |
| rsbuild/react-jest/package.json | Remove old Jest-based example package. |
| rsbuild/react-jest/jest.config.ts | Remove Jest config. |
| rsbuild/react-jest/jest-setup.ts | Remove Jest setup file. |
| rsbuild/react-jest/README.md | Remove Jest example README. |
Comments suppressed due to low confidence (1)
rstest/rsbuild-react/package.json:10
- If this package is intended to run tests using the Rsbuild pipeline (as implied by the presence of
rsbuild.config.tsandrstest.config.ts),@rstest/adapter-rsbuildshould be included indevDependencies(consistent with otherrstest/rsbuild-*examples). Without the adapter, tests may fail to compile/resolve non-JS imports such assrc/App.tsximporting./App.css.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move some Rstest examples to rstest folder.