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: recognize type definition for screen of testing-library/react #903

Merged
merged 3 commits into from
Jan 20, 2021

Conversation

koba04
Copy link
Collaborator

@koba04 koba04 commented Jan 15, 2021

Currently, screen isn't recognized because @types/testing-library__react doesn't have the type definition.

Screen Shot 2021-01-15 at 20 00 28

jest doesn't raise the error because diagnostics of ts-jest is disabled.

This can be fixed by updating @testing-library/react to v10 and I've enabled the diagnostics again.

But it causes another problem caused by a breaking change of @testing-library/dom v7.

MutationObserver shim removed.
https://github.com/testing-library/dom-testing-library/releases/tag/v7.0.0

To fix this, I've updated jest packages to v25, which includes MutationObserver.

Unfortunatelly, some tests in use-swr-test.tsx are still failed. I can fix these tests, but they have already been fixed in separated files at #901.
I assume this PR would pass CI after #881 and #896 have been merged and removed duplicate tests.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 15, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7657734:

Sandbox Source
SWR-Basic Configuration
SWR-States Configuration
SWR-Infinite Configuration

@koba04 koba04 marked this pull request as ready for review January 20, 2021 14:47
@koba04
Copy link
Collaborator Author

koba04 commented Jan 20, 2021

Duplicate tests have been removed via #914, so this is now ready for review.

Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!

@shuding shuding merged commit 6907d42 into vercel:master Jan 20, 2021
@koba04
Copy link
Collaborator Author

koba04 commented Jan 20, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants