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

[test] Properly wait for promise to resolve before expect #3597

Merged
merged 1 commit into from Jan 12, 2022

Conversation

m4theushw
Copy link
Member

Fixes one test not running in Safari: https://app.circleci.com/pipelines/github/mui-org/material-ui-x/11257/workflows/486e64b7-1fa4-44dc-8afa-e891edf3d561/jobs/65177

The solution is a workaround I proposed in #3372 (comment). Basically, the unit tests run with a fake clock, which causes waitFor to also run with the fake clock. Here I call the native setTimeout to make sure that the promise was resolved. With #3558 I think we'll be able to use the fake clock on a per-test case basis, not in the entire suite.

I also took the opportunity to copy test/cli.js from the core repo. This allows to debug each unit test using VSCode.

@m4theushw m4theushw merged commit 84383bc into mui:master Jan 12, 2022
@m4theushw m4theushw deleted the broken-ci branch January 12, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants