Skip to content

Commit 7399d48

Browse files
authored
chore: get rid of warnings when running react tests (#11821)
1 parent 90d6908 commit 7399d48

File tree

4 files changed

+251
-265
lines changed

4 files changed

+251
-265
lines changed

examples/react/.babelrc.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,4 @@
22

33
module.exports = {
44
presets: ['@babel/preset-env', '@babel/preset-react'],
5-
plugins: [
6-
[
7-
'@babel/plugin-proposal-class-properties',
8-
{
9-
loose: true,
10-
},
11-
],
12-
],
135
};

examples/react/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
},
99
"devDependencies": {
1010
"@babel/core": "*",
11-
"@babel/plugin-proposal-class-properties": "*",
1211
"@babel/preset-env": "*",
1312
"@babel/preset-react": "*",
1413
"babel-jest": "*",

examples/snapshot/__tests__/link.react.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ it('changes the class when hovered', () => {
3333
expect(tree).toMatchSnapshot();
3434

3535
// manually trigger the callback
36-
tree.props.onMouseEnter();
36+
renderer.act(() => {
37+
tree.props.onMouseEnter();
38+
});
3739
// re-rendering
3840
tree = component.toJSON();
3941
expect(tree).toMatchSnapshot();
4042

4143
// manually trigger the callback
42-
tree.props.onMouseLeave();
44+
renderer.act(() => {
45+
tree.props.onMouseLeave();
46+
});
4347
// re-rendering
4448
tree = component.toJSON();
4549
expect(tree).toMatchSnapshot();

0 commit comments

Comments
 (0)