mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-08-30 16:58:03 +08:00
Rename and update vitest type declarations
Rename vitest.d.ts to vitest-setup.d.ts to avoid TypeScript module resolution conflicts. Add custom matcher type declarations directly in this file following Vitest documentation recommendations with import statement.
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
import "vitest";
|
||||
|
||||
// Custom matchers from tests/vitest/helpers.js
|
||||
interface CustomMatchers<R = unknown> {
|
||||
toBeLocalized(): R;
|
||||
toBeLocalizationOf(str: string): R;
|
||||
}
|
||||
|
||||
declare module "vitest" {
|
||||
// Export vitest functions for explicit imports (non-globals mode)
|
||||
export const describe: (typeof import("vitest/dist/index.js"))["describe"];
|
||||
export const it: (typeof import("vitest/dist/index.js"))["it"];
|
||||
export const test: (typeof import("vitest/dist/index.js"))["test"];
|
||||
@@ -8,4 +17,8 @@ declare module "vitest" {
|
||||
export const afterEach: (typeof import("vitest/dist/index.js"))["afterEach"];
|
||||
export const beforeAll: (typeof import("vitest/dist/index.js"))["beforeAll"];
|
||||
export const afterAll: (typeof import("vitest/dist/index.js"))["afterAll"];
|
||||
|
||||
// Custom matcher type augmentations for Vitest 4.x
|
||||
interface Assertion<T = any> extends CustomMatchers<T> {}
|
||||
interface AsymmetricMatchersContaining extends CustomMatchers {}
|
||||
}
|
||||
Reference in New Issue
Block a user