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: storybook mocks should be in testSetupAfterEnv to make sure testing-library is cleanup properly [no issue] #969

Conversation

christophehurpeau
Copy link
Contributor

@christophehurpeau christophehurpeau commented Sep 13, 2023

When testing-library is loaded, it checks for an afterAll to add the cleanup step.
But when we load decorators in the test-setup, as it's in early initialization, jest has not yet initialized the hooks. So, no cleanup
I made a fix that obsiously did not work properly: #804 maybe because jest parses requires ?

Example on react-native tests (yarn test:native --no-cache):
BEFORE: 48.661s
AFTER: 35.993s

Example on web tests (yarn test:web --no-cache):
BEFORE: 203.242s
AFTER: 164.08s

@christophehurpeau christophehurpeau requested a review from a team as a code owner September 13, 2023 18:58
@reviewflow
Copy link

reviewflow bot commented Sep 13, 2023

Progress

☑️ Step 1: ✏️ Write code
☑️ Step 2: 💚 Checks
☑️ Step 3: 👌 Code Review
☑️ Step 4: 🚦 Merge Pull Request

Options:

  • 🔜 automerge: Automatically merge when this PR is ready and has no failed statuses. When the repository requires branches to be up to date before merging, it merges default branch, with a queue per repo to prevent multiple merges when several PRs are ready. A fail job prevents the merge.
  • 🚦 skip-ci: Add [skip ci] on merge commit when merge is done with autoMerge.

Actions:

  • 🐛 Force updating reviewflow checks for this PR. Use this to try to fix reviewflow checks that are still missing/pending, which might happen if webhook failed or something bad happened when reviewflow tried to send the status check to github.
  • 🔄 update branch: Merge base branch in this PR's branch. Only works if merging is possible without conflicts.

@reviewflow reviewflow bot added the 🔜 automerge Synced by reviewflow for merge/automerge label Sep 14, 2023
@reviewflow reviewflow bot merged commit 10ed164 into main Sep 14, 2023
8 of 9 checks passed
@reviewflow reviewflow bot deleted the fix/storybook-mocks-should-be-in-testSetupAfterEnv-to-make-sure-testing-library-is-cleanup-properly branch September 14, 2023 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔜 automerge Synced by reviewflow for merge/automerge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants