-
Notifications
You must be signed in to change notification settings - Fork 123
Migrate to rsbuild #125
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
base: master
Are you sure you want to change the base?
Migrate to rsbuild #125
Conversation
close #105 |
@L4Ph - the builds seems to be failing in CI, looks like yarn lock file is out of sync. Can you take a look pls? |
I think you need to make some changes on the CI side. |
Or would it be better to submit a PR without using berry (yarn v2 or later)? |
yes, that would be ideal!. |
@hellomuthu23 fixed |
🤔 |
I think that eslint cannot be found because it does not exist in deps, so why does this error occur ... |
Ah, I see. So eslint is included in the CRA... |
This pull request introduces significant updates to the testing configuration, build system, and test suite, transitioning from
react-scripts
torsbuild
and enhancing test reliability through better mocking practices. Key changes include the addition ofrsbuild
configuration, updates tojest
setup, and improvements to test files for better maintainability.Build System Updates:
react-scripts
withrsbuild
as the build tool, updating thestart
,build
, andtest
scripts inpackage.json
accordingly. Added@rsbuild/core
and@rsbuild/plugin-react
as dependencies. [1] [2]rsbuild.config.ts
file to configurersbuild
with React plugin support and environment variable definitions.Testing Configuration Enhancements:
jest.config.ts
file to configurejest
withjsdom
as the test environment, SWC for TypeScript transformation, and stub mapping for static assets.package.json
to includejest
,jest-environment-jsdom
, andjest-transform-stub
as dependencies for the new testing setup.Test Suite Improvements:
CardConfigs
inCardPicker.test.tsx
to stubgetRandomEmoji
and added abeforeEach
block to clear mocks before each test. [1] [2] [3]PlayerCard.test.tsx
by fully mockingplayerService
and removing unnecessaryjest.spyOn
calls. [1] [2]Poker.test.tsx
by switching to type-safe mocks forgamesService
and adding anafterEach
block to restore mocks after each test. [1] [2] [3] [4]beforeEach
to clear mocks ingames.test.ts
, improving test isolation.Minor Updates:
index.html
to use theassetPrefix
variable for better compatibility with the new build system.