File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ window.matchMedia =
2323 } ;
2424
2525// Mock scrollIntoView - not implemented in JSDOM but used by Ionic components
26- Element . prototype . scrollIntoView = function ( ) { } ;
26+ Element . prototype . scrollIntoView = function ( ) { } ;
2727
2828// Run before each test SUITE
2929beforeAll ( ( ) => {
Original file line number Diff line number Diff line change 1+ import 'vitest' ;
2+
3+ // Extend the expect interface with testing-library matchers
4+ declare global {
5+ // Add typings for Vitest global functions
6+ const describe : typeof import ( 'vitest' ) [ 'describe' ] ;
7+ const it : typeof import ( 'vitest' ) [ 'it' ] ;
8+ const test : typeof import ( 'vitest' ) [ 'test' ] ;
9+ const expect : typeof import ( 'vitest' ) [ 'expect' ] ;
10+ const vi : typeof import ( 'vitest' ) [ 'vi' ] ;
11+ const beforeEach : typeof import ( 'vitest' ) [ 'beforeEach' ] ;
12+ const afterEach : typeof import ( 'vitest' ) [ 'afterEach' ] ;
13+ const beforeAll : typeof import ( 'vitest' ) [ 'beforeAll' ] ;
14+ const afterAll : typeof import ( 'vitest' ) [ 'afterAll' ] ;
15+
16+ // Extend the globalThis interface to allow assigning Vitest functions
17+ interface Window {
18+ expect : typeof import ( 'vitest' ) [ 'expect' ] ;
19+ afterEach : typeof import ( 'vitest' ) [ 'afterEach' ] ;
20+ beforeEach : typeof import ( 'vitest' ) [ 'beforeEach' ] ;
21+ describe : typeof import ( 'vitest' ) [ 'describe' ] ;
22+ it : typeof import ( 'vitest' ) [ 'it' ] ;
23+ vi : typeof import ( 'vitest' ) [ 'vi' ] ;
24+ beforeAll : typeof import ( 'vitest' ) [ 'beforeAll' ] ;
25+ afterAll : typeof import ( 'vitest' ) [ 'afterAll' ] ;
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments