Unverified Commit fe4dc744 authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Polyfill rAF in test environment (#3340)

parent c66c296f
Showing with 7 additions and 0 deletions
+7 -0
...@@ -22,3 +22,9 @@ require('whatwg-fetch'); ...@@ -22,3 +22,9 @@ require('whatwg-fetch');
// Object.assign() is commonly used with React. // Object.assign() is commonly used with React.
// It will use the native implementation if it's present and isn't buggy. // It will use the native implementation if it's present and isn't buggy.
Object.assign = require('object-assign'); Object.assign = require('object-assign');
// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
// We don't polyfill it in the browser--this is user's responsibility.
if (process.env.NODE_ENV === 'test') {
require('raf').polyfill(global);
}
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
"postcss-flexbugs-fixes": "3.2.0", "postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.6", "postcss-loader": "2.0.6",
"promise": "8.0.1", "promise": "8.0.1",
"raf": "3.4.0",
"react-dev-utils": "^4.1.0", "react-dev-utils": "^4.1.0",
"style-loader": "0.19.0", "style-loader": "0.19.0",
"sw-precache-webpack-plugin": "0.11.4", "sw-precache-webpack-plugin": "0.11.4",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment