Skip to content

fix: make sure setTimeout exists on global #400

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

Conversation

tomanagle
Copy link
Contributor

What:
Added a check to make sure globalObj.setTimeout exists before referencing the _isMockFunction parameter.

Why:
I was getting the following error in my console when using @testing-library/react in my project.

TypeError: Cannot read property '_isMockFunction' of undefined

How:
Made sure globalObj.setTimeout existed before referencing the child property _isMockFunction

Checklist:

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 6, 2019

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 eade4f5:

Sandbox Source
react-testing-library-examples Configuration

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Thank you!

@kentcdodds kentcdodds merged commit 04455cd into testing-library:master Nov 6, 2019
@kentcdodds
Copy link
Member

@all-contributors please add @tomanagle for code

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @tomanagle! 🎉

@kentcdodds
Copy link
Member

🎉 This PR is included in version 6.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants