Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ window.matchMedia =
};

// Mock scrollIntoView - not implemented in JSDOM but used by Ionic components
Element.prototype.scrollIntoView = function() {};
Element.prototype.scrollIntoView = function () {};

// Run before each test SUITE
beforeAll(() => {
Expand Down
27 changes: 27 additions & 0 deletions frontend/src/types/vitest.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'vitest';

// Extend the expect interface with testing-library matchers
declare global {
// Add typings for Vitest global functions
const describe: typeof import('vitest')['describe'];
const it: typeof import('vitest')['it'];
const test: typeof import('vitest')['test'];
const expect: typeof import('vitest')['expect'];
const vi: typeof import('vitest')['vi'];
const beforeEach: typeof import('vitest')['beforeEach'];
const afterEach: typeof import('vitest')['afterEach'];
const beforeAll: typeof import('vitest')['beforeAll'];
const afterAll: typeof import('vitest')['afterAll'];

// Extend the globalThis interface to allow assigning Vitest functions
interface Window {
expect: typeof import('vitest')['expect'];
afterEach: typeof import('vitest')['afterEach'];
beforeEach: typeof import('vitest')['beforeEach'];
describe: typeof import('vitest')['describe'];
it: typeof import('vitest')['it'];
vi: typeof import('vitest')['vi'];
beforeAll: typeof import('vitest')['beforeAll'];
afterAll: typeof import('vitest')['afterAll'];
}
}