File tree Expand file tree Collapse file tree 3 files changed +28
-9
lines changed Expand file tree Collapse file tree 3 files changed +28
-9
lines changed Original file line number Diff line number Diff line change 22import '@testing-library/jest-dom' ;
33
44// Mock ResizeObserver for tests
5- ( global as any ) . ResizeObserver = jest . fn ( ) . mockImplementation ( ( ) => ( {
5+ declare const global : any ;
6+ global . ResizeObserver = jest . fn ( ) . mockImplementation ( ( ) => ( {
67 observe : jest . fn ( ) ,
78 unobserve : jest . fn ( ) ,
89 disconnect : jest . fn ( ) ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const Wrapper = (props: PropsWithChildren<{}>) => (
1111) ;
1212
1313describe ( 'given useParallaxController hook' , ( ) => {
14- const { window } = global as any ;
14+ const { window } = ( global as any ) ;
1515 afterEach ( ( ) => {
1616 ( global as any ) . window = window ;
1717 } ) ;
Original file line number Diff line number Diff line change @@ -6,12 +6,30 @@ declare global {
66// Import jest-dom types
77import '@testing-library/jest-dom' ;
88
9- // Extend Jest matchers
10- declare module '@jest/expect' {
11- interface Matchers < R > {
12- toBeInTheDocument ( ) : R ;
13- toHaveAttribute ( attr : string , value ?: string ) : R ;
14- toHaveClass ( className : string ) : R ;
15- toHaveStyle ( css : string | Record < string , any > ) : R ;
9+ // Extend Jest matchers for all expect types
10+ declare global {
11+ namespace jest {
12+ interface Matchers < R > {
13+ toBeInTheDocument ( ) : R ;
14+ toHaveAttribute ( attr : string , value ?: string ) : R ;
15+ toHaveClass ( className : string ) : R ;
16+ toHaveStyle ( css : string | Record < string , any > ) : R ;
17+ toHaveTextContent ( text : string | RegExp ) : R ;
18+ toBeVisible ( ) : R ;
19+ toBeDisabled ( ) : R ;
20+ toBeEnabled ( ) : R ;
21+ toBeRequired ( ) : R ;
22+ toBeValid ( ) : R ;
23+ toBeInvalid ( ) : R ;
24+ toHaveValue ( value : string | string [ ] | number ) : R ;
25+ toHaveDisplayValue ( value : string | RegExp | ( string | RegExp ) [ ] ) : R ;
26+ toBeChecked ( ) : R ;
27+ toBePartiallyChecked ( ) : R ;
28+ toHaveDescription ( text ?: string | RegExp ) : R ;
29+ toHaveAccessibleDescription ( text ?: string | RegExp ) : R ;
30+ toHaveAccessibleName ( text ?: string | RegExp ) : R ;
31+ toHaveFormValues ( expectedValues : Record < string , any > ) : R ;
32+ toHaveFocus ( ) : R ;
33+ }
1634 }
1735}
You can’t perform that action at this time.
0 commit comments