Skip to content

Commit 63fc17e

Browse files
li-jia-nanWxh16144
andauthored
test: rm legacy react-dom/test-utils (#525)
* test: rm legacy react-dom/test-utils * chore: fix * ci: fixed codecov warning (#526) ref: codecov/codecov-action#190 --------- Co-authored-by: 红 <[email protected]>
1 parent 9d586de commit 63fc17e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/react-component-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ jobs:
9494
steps:
9595
- name: checkout
9696
uses: actions/checkout@master
97+
with:
98+
# https://github.com/codecov/codecov-action/issues/190
99+
fetch-depth: 2
97100

98101
- name: restore cache from package-lock.json
99102
uses: actions/cache@v2

tests/Portal.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
/* eslint-disable react/no-array-index-key */
2+
import { act, render } from '@testing-library/react';
13
import React, { StrictMode, useEffect } from 'react';
2-
import { render } from '@testing-library/react';
3-
import { act } from 'react-dom/test-utils';
4-
import PortalWrapper, { getOpenCount } from '../src/PortalWrapper';
54
import Portal from '../src/Portal';
5+
import PortalWrapper, { getOpenCount } from '../src/PortalWrapper';
66

77
describe('Portal', () => {
88
let domContainer: HTMLDivElement;

tests/react.test.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react';
2-
import { act } from 'react-dom/test-utils';
3-
import { render, unmount, _r, _u } from '../src/React/render';
1+
import { act } from '@testing-library/react';
2+
import { _r, _u, render, unmount } from '../src/React/render';
43

54
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
65

0 commit comments

Comments
 (0)