From 89a14b7b3bde83f55a0dcd045c88cea519c975e8 Mon Sep 17 00:00:00 2001 From: promer94 Date: Sun, 31 Mar 2024 18:50:33 +0800 Subject: [PATCH] test: remove console.error times check (#2918) * test: remove console.error times check * remove legacyroot flag for canary --- .github/workflows/test-canary.yml | 2 -- test/use-swr-promise.test.tsx | 3 --- test/use-swr-subscription.test.tsx | 3 --- test/use-swr-suspense.test.tsx | 2 -- 4 files changed, 10 deletions(-) diff --git a/.github/workflows/test-canary.yml b/.github/workflows/test-canary.yml index 9d8c5c0ba..906c918d0 100644 --- a/.github/workflows/test-canary.yml +++ b/.github/workflows/test-canary.yml @@ -19,8 +19,6 @@ jobs: run: corepack pnpm upgrade react@canary react-dom@canary use-sync-external-store@canary - name: Lint and test - env: - TEST_REACT_LEGACY: 1 run: | pnpm clean pnpm build diff --git a/test/use-swr-promise.test.tsx b/test/use-swr-promise.test.tsx index 35027b4d8..4784b4101 100644 --- a/test/use-swr-promise.test.tsx +++ b/test/use-swr-promise.test.tsx @@ -146,9 +146,6 @@ describe('useSWR - promise', () => { await screen.findByText('loading') await act(() => sleep(100)) // wait 100ms until the request inside throws await screen.findByText('error boundary') - - // 1 for js-dom 1 for react-error-boundary - expect(console.error).toHaveBeenCalledTimes(3) }) it('should handle same fallback promise that is already pending', async () => { diff --git a/test/use-swr-subscription.test.tsx b/test/use-swr-subscription.test.tsx index b172aa5a4..d8dfb1ed3 100644 --- a/test/use-swr-subscription.test.tsx +++ b/test/use-swr-subscription.test.tsx @@ -321,8 +321,5 @@ describe('useSWRSubscription', () => { await screen.findByText( 'The `subscribe` function must return a function to unsubscribe.' ) - - // 1 for js-dom 1 for react-error-boundary - expect(console.error).toHaveBeenCalledTimes(2) }) }) diff --git a/test/use-swr-suspense.test.tsx b/test/use-swr-suspense.test.tsx index d6e678dcc..1b0e07b22 100644 --- a/test/use-swr-suspense.test.tsx +++ b/test/use-swr-suspense.test.tsx @@ -115,8 +115,6 @@ describe('useSWR - suspense', () => { // hydration screen.getByText('fallback') await screen.findByText('error boundary') - // 1 for js-dom 1 for react-error-boundary - expect(console.error).toHaveBeenCalledTimes(3) }) it('should render cached data with error', async () => {