Skip to content

Commit 2cc00ec

Browse files
committed
chore(react): use @testing-library/react
1 parent b36bf88 commit 2cc00ec

File tree

4 files changed

+184
-21
lines changed

4 files changed

+184
-21
lines changed

packages/react/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,15 @@
2727
"react-dom": "^16.0.0"
2828
},
2929
"devDependencies": {
30+
"@testing-library/react": "^10.0.6",
3031
"@types/hoist-non-react-statics": "^3.3.1",
3132
"@types/react": "^16.9.35",
32-
"@types/react-test-renderer": "^16.9.2",
3333
"jest": "^24.7.1",
3434
"npm-run-all": "^4.1.2",
3535
"prettier": "^1.17.0",
3636
"prettier-check": "^2.0.0",
3737
"react": "^16.0.0",
3838
"react-dom": "^16.0.0",
39-
"react-test-renderer": "^16.13.1",
4039
"rimraf": "^2.6.3",
4140
"tslint": "^5.16.0",
4241
"tslint-react": "^5.0.0",

packages/react/test/errorboundary.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as React from 'react';
2-
import { create } from 'react-test-renderer';
32

43
import { ErrorBoundary } from '../src/errorboundary';
54

packages/react/test/profiler.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { render } from '@testing-library/react';
12
import * as React from 'react';
2-
import { create } from 'react-test-renderer';
33

44
import { UNKNOWN_COMPONENT, withProfiler } from '../src/profiler';
55

@@ -44,7 +44,7 @@ describe('withProfiler', () => {
4444

4545
expect(mockPopActivity).toHaveBeenCalledTimes(0);
4646

47-
const profiler = create(<ProfiledComponent />);
47+
const profiler = render(<ProfiledComponent />);
4848
profiler.unmount();
4949

5050
jest.runAllTimers();
@@ -58,7 +58,7 @@ describe('withProfiler', () => {
5858
const ProfiledComponent = withProfiler(() => <h1>Testing</h1>);
5959

6060
expect(mockPushActivity).toHaveBeenCalledTimes(0);
61-
create(<ProfiledComponent />);
61+
render(<ProfiledComponent />);
6262
expect(mockPushActivity).toHaveBeenCalledTimes(1);
6363
expect(mockPushActivity).toHaveBeenLastCalledWith(UNKNOWN_COMPONENT, {
6464
description: `<${UNKNOWN_COMPONENT}>`,

0 commit comments

Comments
 (0)