Skip to content

Commit 6be4b9a

Browse files
authored
Merge pull request #22 from zhuangya/migrate-testing-library
chore: migrate testing-library
2 parents eca33fb + 2b6b22c commit 6be4b9a

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

jest.setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@testing-library/jest-dom/extend-expect';

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
"@commitlint/cli": "^7.5.2",
4747
"@commitlint/config-conventional": "^7.5.0",
4848
"@ice/spec": "^0.1.4",
49+
"@testing-library/react": "^9.3.2",
50+
"@testing-library/jest-dom": "^4.2.3",
4951
"@types/jest": "^24.0.12",
5052
"@types/node": "^12.0.0",
5153
"@types/path-to-regexp": "^1.7.0",
@@ -54,17 +56,16 @@
5456
"@types/url-parse": "^1.4.3",
5557
"codecov": "^3.4.0",
5658
"eslint": "^5.16.0",
57-
"stylelint": "^10.1.0",
5859
"husky": "^2.2.0",
5960
"jest": "^24.7.1",
60-
"jest-dom": "^3.4.0",
6161
"react": "^16.7.0",
6262
"react-dom": "^16.7.0",
63-
"react-testing-library": "^7.0.0",
63+
"stylelint": "^10.1.0",
6464
"ts-jest": "^24.0.2",
6565
"typescript": "^3.4.4"
6666
},
6767
"jest": {
68+
"setupFilesAfterEnv": ["./jest.setup.ts"],
6869
"coverageDirectory": "./coverage/",
6970
"collectCoverage": true,
7071
"preset": "ts-jest"

packages/icestark-app/tests/index.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'jest-dom/extend-expect';
2-
31
import {
42
getBasename,
53
getMountNode,

tests/index.spec.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import 'react-testing-library/cleanup-after-each';
2-
import 'jest-dom/extend-expect';
3-
41
import * as React from 'react';
5-
import { render } from 'react-testing-library';
2+
import { render } from '@testing-library/react';
63
import { AppRouter, AppRoute, AppLink, appHistory } from '../src/index';
74
import matchPath from '../src/matchPath';
85
import { loadAssets } from '../src/handleAssets';

0 commit comments

Comments
 (0)