Skip to content

Commit

Permalink
Polyfill the requestAnimationFrame for react-dom and properly test th…
Browse files Browse the repository at this point in the history
…at the snapshots are actually shallow
  • Loading branch information
negativetwelve committed Sep 3, 2017
1 parent 325cea6 commit 0a2c433
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -15,6 +15,7 @@
"jest": "^21.0.0-beta.1",
"lerna": "^2.0.0",
"lint-staged": "^4.0.3",
"raf": "^3.3.2",
"rimraf": "^2.6.1"
},
"babel": {
Expand Down
3 changes: 2 additions & 1 deletion packages/jest-plugin-it-shallow-renders/package.json
Expand Up @@ -32,7 +32,8 @@
"react": "*"
},
"devDependencies": {
"react": "^16.0.0-alpha"
"react": "^16.0.0-alpha",
"react-dom": "^16.0.0-alpha"
},
"scripts": {
"build": "babel src --out-dir build --ignore \"**/__tests__/**\"",
Expand Down
@@ -0,0 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`itShallowRenders Text shallow renders snapshot 1`] = `
<View>
<div />
</View>
`;

exports[`itShallowRenders View shallow renders snapshot 1`] = `
<div>
<div />
</div>
`;
@@ -1,4 +1,5 @@
// Libraries
import 'raf/polyfill';
import React from 'react';

// Modules
Expand All @@ -7,7 +8,7 @@ import itShallowRenders from '../itShallowRenders';

// Test Components
const View = () => <div><div /></div>;
const Text = () => <div><div /></div>;
const Text = () => <View><div /></View>;


/* eslint-disable no-undef */
Expand Down
19 changes: 19 additions & 0 deletions yarn.lock
Expand Up @@ -4170,6 +4170,10 @@ performance-now@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"

performance-now@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"

pify@^2.0.0, pify@^2.2.0, pify@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
Expand Down Expand Up @@ -4271,6 +4275,12 @@ qs@~6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"

raf@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/raf/-/raf-3.3.2.tgz#0c13be0b5b49b46f76d6669248d527cf2b02fe27"
dependencies:
performance-now "^2.1.0"

randomatic@^1.1.3:
version "1.1.7"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c"
Expand All @@ -4291,6 +4301,15 @@ react-deep-force-update@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-1.1.1.tgz#bcd31478027b64b3339f108921ab520b4313dc2c"

react-dom@^16.0.0-alpha:
version "16.0.0-beta.5"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.0.0-beta.5.tgz#c9c2e5c059576f77b55e8c3959535d63cb1227e5"
dependencies:
fbjs "^0.8.9"
loose-envify "^1.1.0"
object-assign "^4.1.0"
prop-types "^15.5.6"

react-proxy@^1.1.7:
version "1.1.8"
resolved "https://registry.yarnpkg.com/react-proxy/-/react-proxy-1.1.8.tgz#9dbfd9d927528c3aa9f444e4558c37830ab8c26a"
Expand Down

0 comments on commit 0a2c433

Please sign in to comment.