Skip to content

Commit

Permalink
test: rm legacy react-dom/test-utils (#525)
Browse files Browse the repository at this point in the history
* test: rm legacy react-dom/test-utils

* chore: fix

* ci: fixed codecov warning (#526)

ref: codecov/codecov-action#190

---------

Co-authored-by: 红 <wxh1220@gmail.com>
  • Loading branch information
li-jia-nan and Wxh16144 authored Apr 29, 2024
1 parent 9d586de commit 63fc17e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/react-component-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@master
with:
# https://github.com/codecov/codecov-action/issues/190
fetch-depth: 2

- name: restore cache from package-lock.json
uses: actions/cache@v2
Expand Down
6 changes: 3 additions & 3 deletions tests/Portal.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable react/no-array-index-key */
import { act, render } from '@testing-library/react';
import React, { StrictMode, useEffect } from 'react';
import { render } from '@testing-library/react';
import { act } from 'react-dom/test-utils';
import PortalWrapper, { getOpenCount } from '../src/PortalWrapper';
import Portal from '../src/Portal';
import PortalWrapper, { getOpenCount } from '../src/PortalWrapper';

describe('Portal', () => {
let domContainer: HTMLDivElement;
Expand Down
5 changes: 2 additions & 3 deletions tests/react.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { act } from 'react-dom/test-utils';
import { render, unmount, _r, _u } from '../src/React/render';
import { act } from '@testing-library/react';
import { _r, _u, render, unmount } from '../src/React/render';

globalThis.IS_REACT_ACT_ENVIRONMENT = true;

Expand Down

0 comments on commit 63fc17e

Please sign in to comment.