Skip to content

Commit

Permalink
chore: get rid of warnings when running react tests (#11821)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Sep 8, 2021
1 parent 90d6908 commit 7399d48
Show file tree
Hide file tree
Showing 4 changed files with 251 additions and 265 deletions.
8 changes: 0 additions & 8 deletions examples/react/.babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,4 @@

module.exports = {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: [
[
'@babel/plugin-proposal-class-properties',
{
loose: true,
},
],
],
};
1 change: 0 additions & 1 deletion examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"devDependencies": {
"@babel/core": "*",
"@babel/plugin-proposal-class-properties": "*",
"@babel/preset-env": "*",
"@babel/preset-react": "*",
"babel-jest": "*",
Expand Down
8 changes: 6 additions & 2 deletions examples/snapshot/__tests__/link.react.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ it('changes the class when hovered', () => {
expect(tree).toMatchSnapshot();

// manually trigger the callback
tree.props.onMouseEnter();
renderer.act(() => {
tree.props.onMouseEnter();
});
// re-rendering
tree = component.toJSON();
expect(tree).toMatchSnapshot();

// manually trigger the callback
tree.props.onMouseLeave();
renderer.act(() => {
tree.props.onMouseLeave();
});
// re-rendering
tree = component.toJSON();
expect(tree).toMatchSnapshot();
Expand Down
Loading

0 comments on commit 7399d48

Please sign in to comment.