We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa413eb commit 24c767bCopy full SHA for 24c767b
1 file changed
packages/react/src/utils/testing.tsx
@@ -1,5 +1,6 @@
1
import {render as HTMLRender} from '@testing-library/react'
2
import {it, expect, vi} from 'vitest'
3
+import {reactMajorVersion} from './environment'
4
5
export function implementsClassName(Component: React.ElementType, baseClassName?: string) {
6
it('renders with the custom className', () => {
@@ -21,7 +22,9 @@ export function withExpectedConsoleError(callback: () => void) {
21
22
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {})
23
try {
24
callback()
- expect(consoleSpy).toHaveBeenCalled()
25
+ if (reactMajorVersion < 19) {
26
+ expect(consoleSpy).toHaveBeenCalled()
27
+ }
28
} finally {
29
consoleSpy.mockRestore()
30
}
0 commit comments