ReferenceError: requestAnimationFrame is not defined
See original GitHub issueVersion
1.3.0
I’m using mocha / enzyme / jsdom to run tests which incude the <Typeahead>
and am getting
ReferenceError: requestAnimationFrame is not defined at Object.componentDidMount (node_modules/react-bootstrap-typeahead/lib/Overlay.react.js:71:37)
I tried faking it with global.requestAnimationFrame = function(cb) { cb(0) }
but looks like there’s other issues, the test just hangs and I haven’t found the cause yet.
I haven’t found a version of jsdom which polyfills requestAnimationFrame
, have you got a test using these packages to work? The previous versions of the package did run correctly.
There’s also three warnings from this package:
Warning: ReactTestUtils has been moved to react-dom/test-utils. Update references to remove this warning. Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead. Warning: Portal: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you’re not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:7 (4 by maintainers)
Top GitHub Comments
I am seeing this as well using 1.4.0 with Mocha/Chai and
ReactTestUtils.renderIntoDocument()
following so I can upgrade to 1.3.0 when this is resolved. Thanks!