Skip to content
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

Fix failing admin test when running all tests together #7136

Merged
merged 4 commits into from
Jan 25, 2022

Conversation

thdk
Copy link
Contributor

@thdk thdk commented Jan 25, 2022

I noticed that on my machine this test always failed with a timeout exception when running yarn test-unit in the root project.

It did not fail however when running yarn test-unit --watch because then it took just below the default 5000ms timeout setting of jest.

I have increased the timeout for this specific test and applied some best practices for this test.

I've also fixed the incorrect intellisense for the test files by explicitly setting jest in the required types in tsconfig.json so it doesn't look at mochas typescript definition files any longer.

This test otherwise often fails when running all tests. If only running
this test it needs just below the default 5000ms.
If this is not set here, IDE tools such as VS Code will load all
typescript definitions from all node_modules in the tree.

Since both jest and mocha are in the root node_modules folder and each
of them have a declaration for the describe and it function used in our
tests, it doesn't know which one to take and intellisense is wrong.

This is a common issue in a monorepo using workspaces where all
dependencies of all packages are hoisted in the root folder.
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook January 25, 2022 07:07 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin January 25, 2022 07:07 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin January 25, 2022 12:08 Inactive
@vercel vercel bot temporarily deployed to Preview – react-admin-storybook January 25, 2022 12:08 Inactive
@WiXSL
Copy link
Contributor

WiXSL commented Jan 25, 2022

Thanks, I really like this one!

@WiXSL WiXSL added the RFR Ready For Review label Jan 25, 2022
@fzaninotto fzaninotto merged commit a03108f into marmelab:master Jan 25, 2022
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the v3.19.8 milestone Jan 25, 2022
@thdk thdk deleted the fix/admin-test branch January 25, 2022 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants