Skip to content

Commit

Permalink
Merge pull request #726 from aberezkin/revival
Browse files Browse the repository at this point in the history
  • Loading branch information
aberezkin authored Mar 16, 2020
2 parents 19dbb07 + df6c8aa commit 23cf0b8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ demo/dist
npm-debug.log
yarn.lock
package-lock.json
*.log
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"dependencies": {
"prop-types": "^15.5.10",
"react-autowhatever": "^10.1.2",
"react-autowhatever": "^10.2.1",
"shallow-equal": "^1.0.0"
},
"peerDependencies": {
Expand All @@ -40,7 +40,7 @@
"babel-eslint": "^7.2.3",
"babel-loader": "^6.4.1",
"babel-plugin-react-transform": "^2.0.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.6",
"babel-plugin-transform-react-remove-prop-types": "0.4.19",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
Expand All @@ -65,8 +65,8 @@
"openurl": "^1.1.1",
"postcss-loader": "^1.3.3",
"prettier": "1.14.2",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-modal": "^1.7.7",
"react-transform-hmr": "^1.0.4",
"sinon": "^1.17.7",
Expand Down
15 changes: 13 additions & 2 deletions test/helpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import chai, { expect } from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import SyntheticEvent from 'react-dom/lib/SyntheticEvent';
import TestUtils, { Simulate } from 'react-dom/test-utils';

chai.use(sinonChai);
Expand Down Expand Up @@ -39,7 +38,19 @@ export const init = application => {
clearButton = TestUtils.scryRenderedDOMComponentsWithTag(app, 'button')[0];
};

export const syntheticEventMatcher = sinon.match.instanceOf(SyntheticEvent);
// Since react-dom doesn't export SyntheticEvent anymore
export const syntheticEventMatcher = sinon.match(value => {
if (typeof value !== 'object' || value === null) {
return false;
}

const proto = Object.getPrototypeOf(value);

if ('_dispatchListeners' in value && proto && proto.constructor.Interface) {
return true;
}
return false;
}, 'of SyntheticEvent type');
export const childrenMatcher = sinon.match.any;
export const containerPropsMatcher = sinon.match({
id: sinon.match.string,
Expand Down

0 comments on commit 23cf0b8

Please sign in to comment.