Skip to content

Commit

Permalink
Polyfill requestAnimationFrame for React tests with fiber
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Feb 14, 2017
1 parent 660a90a commit 4f3dc17
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ignore]

[include]

[libs]

[options]
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"postcss": "^5.0.14",
"postcss-cli": "^2.3.3",
"postcss-loader": "^0.9.1",
"raf": "^3.3.0",
"react": "16.0.0-alpha.2",
"react-addons-shallow-compare": "16.0.0-alpha.2",
"react-addons-test-utils": "16.0.0-alpha.2",
Expand All @@ -149,6 +150,7 @@
"babel-runtime": "^6.11.6",
"classnames": "^2.2.3",
"dom-helpers": "^2.4.0 || ^3.0.0",
"flow-bin": "^0.39.0",
"loose-envify": "^1.3.0"
},
"peerDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions source/jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ jest.mock('dom-helpers/util/scrollbarSize', () => {
return 20
}
})

// Polyfill requestAnimationFrame() for ReactDOMFrameScheduling
global.requestAnimationFrame = require('raf')
14 changes: 14 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2353,6 +2353,10 @@ flatten@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"

flow-bin@^0.39.0:
version "0.39.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.39.0.tgz#b1012a14460df1aa79d3a728e10f93c6944226d0"

for-in@^0.1.5:
version "0.1.6"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8"
Expand Down Expand Up @@ -4145,6 +4149,10 @@ pbkdf2-compat@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz#b6e0c8fa99494d94e0511575802a59a5c142f288"

performance-now@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"

pify@^2.0.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
Expand Down Expand Up @@ -4552,6 +4560,12 @@ querystringify@0.0.x:
version "0.0.4"
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-0.0.4.tgz#0cf7f84f9463ff0ae51c4c4b142d95be37724d9c"

raf@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/raf/-/raf-3.3.0.tgz#93845eeffc773f8129039f677f80a36044eee2c3"
dependencies:
performance-now "~0.2.0"

randomatic@^1.1.3:
version "1.1.5"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.5.tgz#5e9ef5f2d573c67bd2b8124ae90b5156e457840b"
Expand Down

0 comments on commit 4f3dc17

Please sign in to comment.