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: refactor use-swr-config-callbacks.test.tsx #933

Merged

Conversation

koba04
Copy link
Collaborator

@koba04 koba04 commented Jan 26, 2021

This PR is based on #932, so this should be merged after #932.

The following are the commits for this PR.

I've refactored use-swr-config-callbacks.test.tsx as the same way with #932.
But in this PR, I've added the createResponse function in test/utils.ts. This is used to create a fetcher function.
It's to minimize the usage of setTimeout because tests that depend on the actual time is fragile, so I think we should avoid it and wait for a promise for a response from a fetcher function.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 26, 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 8b3db69:

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

@koba04 koba04 force-pushed the refactor-use-swr-config-callbacks-test branch from 59d37fc to 87eecea Compare January 26, 2021 17:07
@koba04 koba04 marked this pull request as draft January 28, 2021 01:07
@koba04 koba04 force-pushed the refactor-use-swr-config-callbacks-test branch from 080bbc9 to ace7818 Compare March 3, 2021 15:44
@koba04 koba04 marked this pull request as ready for review March 3, 2021 15:56
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.

Thanks for the refactoring!

@shuding shuding merged commit 66aaefd into vercel:master Mar 4, 2021
@koba04
Copy link
Collaborator Author

koba04 commented Mar 4, 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