-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add tests to the app generated by create-react-admin with ra-data-fakerest #9578
Conversation
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.
I also have a few more important remarks.
I tested the 'published' version of the CLI (following the instructions in the Readme) and found out that:
- Running
npm install
to install the build version of the CLI locally fails, because of the following error:Could not resolve dependency: peer react@"^16.5.2 || ^17.0.0" from ink-select-input@4.2.2
(since we now require react 18) => Do we need to update to a newer version ofink-select-input
? - in the generated app, we have both a
.gitignore
and agitignore
file - the generated Readme does not explain how to run the tests
- The test is failing in the generated project, because of a timeout (
Test timed out in 5000ms
) although the app is running properly locally 🤷♂️ - The tests seem to assume we chose an
authProvider
, but it's not mandatory. We should only include the test if anauthProvider
was selected IMO
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.
Code looks good, but:
- There is still a
gitignore
file generated in addition to.gitignore
- Tests are still failing when run in the generated project (timeout after 5000 ms)
FIxed
Not sure what happen on your machine. It works fine on mine and on the CI (#9580) |
Okay so I pushed the investigation further
=> Hence I recommend increasing the timeout a bit by default, otherwise we risk having the test fail on the CI too 🤷 |
How To Test
make build-create-react-admin install
Then from outside the project monorepo, call:
[PATH TO MONOREPO]/node_modules/.bin/create-react-admin myadmin --data-provider ra-data-fakerest --auth-provider none --install npm
like:
./react-admin-next/node_modules/.bin/create-react-admin myadmin2 --data-provider ra-data-fakerest --auth-provider none --install npm
and run the tests: