-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[DOC] how to test with vitest/jest #6020
Comments
@aliemir I managed to get the tests running https://vitest.dev/config/#server-deps-inline |
Hey @borisyordanov thanks! It seems that could fix the problem, but we need to check possible side-effects for this one. We'll get back to you next week. |
Hey @borisyordanov, thank you for opening the issue and writing an explanation for your case 🙏 Adding a documentation section for vitest/jest testing and adding an example will be great for many users imho 🤔 Thank you for sharing your solution for the Same issue also occurs when using Material UI with Remix in SPA mode (#6007). Unfortunately, Material UI has some issues with ESM exports (mui/material-ui#30671), until they resolve those issues we will try to have workaround to get past them in our |
Closing in favor of #6086. We'll update the issue when we have any progress on Material UI side or if we can provide any non-breaking updates to fix this. |
Documentation issue
The testing page does not have any instructions on tesing with partially-implemented browser environment, like jsdom
Describe the thing to improve
Apps built with refine can contain custom logic that needs to be tested. browser tests (e.g cypress/playwright) are a great way to make certain assertions but for other cases unit and integration tests headless testing (e.g vitest/jest) are much more apt.
When I include the
Refine
provider in a vitest environment tests start crashing with this errorThe lack of testing documentation means it's very difficult to make the tests run.
Describe the solution (optional)
https://github.com/refinedev/refine/tree/master/examples contains examples of a unit testing setup with vitest and jest and react testing library
Context
I'm working in a monorepo, built with https://nx.dev/ and pnpm workspaces
tsconfig.app.json
tsconfig.json
tsconfig.spec.json
The text was updated successfully, but these errors were encountered: