Skip to content

Commit 69c3bf1

Browse files
test: remove redundant React Router warning suppression
Amp-Thread-ID: https://ampcode.com/threads/T-019c7d08-04f2-743c-9527-500a06f0ea9f Co-authored-by: Amp <amp@ampcode.com>
1 parent b6b6f44 commit 69c3bf1

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

test/setup.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1 @@
11
import '@testing-library/jest-dom/vitest'
2-
import { beforeAll, afterAll, vi } from 'vitest'
3-
4-
const REACT_ROUTER_FUTURE_WARNING = 'React Router Future Flag Warning'
5-
const originalWarn = console.warn
6-
7-
let warnSpy: ReturnType<typeof vi.spyOn>
8-
9-
beforeAll(() => {
10-
warnSpy = vi
11-
.spyOn(console, 'warn')
12-
.mockImplementation((...args: unknown[]) => {
13-
const [firstArg] = args
14-
if (
15-
typeof firstArg === 'string' &&
16-
firstArg.includes(REACT_ROUTER_FUTURE_WARNING)
17-
) {
18-
return
19-
}
20-
21-
originalWarn(...args)
22-
})
23-
})
24-
25-
afterAll(() => {
26-
warnSpy?.mockRestore()
27-
})

0 commit comments

Comments
 (0)