-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
window.requestAnimationFrame not defined and nodeType null #1644
Comments
jsdom doesn't ship with |
@cpojer okay just fixed that, do you know why the Before: // mutiple children failed test complains about the children not having key prop
{children.map((child, i) => (React.cloneElement(child, {ref: this.addRef})))} After: // so I added key to the prop and then Cannot read property 'nodeType' of null is caused
{children.map((child, i) => (React.cloneElement(child, {key: i, ref: this.addRef})))} |
The test renderer currently doesn't support refs; this is a feature the React team is currently working on. |
Okay, any timetable you may know of? |
I think probably like 15.4 but I'm not on the React team, so not sure. See facebook/react#7649 |
@cpojer thank you! |
React 16 depends on RAF and jsdoc doesn't provide it out of box. shim: https://gist.github.com/paulirish/1579671 refs: jestjs/jest#1644
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hey,
I'm helping test an animation library and my tests are failing because it says that requestAnimationFrame is not defined and nodeType not defined. The code works I've verified that in codepen. However I think its because jest isn't exposing requestAnimationFrame property on the window object. Just to make sure here in MDN docs it should be on the window object. I console log the window object in the test and a very very large object is logged out to my terminal. I'm new to Jest but heres what the test looks like so I may be doing something wrong:
The text was updated successfully, but these errors were encountered: