feat: add testing for the global configs

We want to make sure we aren't missing anything important.
This commit is contained in:
2024-09-25 22:31:08 -07:00
parent 2974c76c48
commit 70fcc1a49a
4 changed files with 383 additions and 18 deletions
+19
View File
@@ -0,0 +1,19 @@
/// <reference types="vitest" />
import type { Assertion, AsymmetricMatchersContaining } from 'vitest';
interface CustomMatchers<R = unknown> {
toContainRules(expected: Record<string, unknown>): R;
}
declare module 'vitest' {
interface Assertion<T = any> extends CustomMatchers<T> {}
interface AsymmetricMatchersContaining extends CustomMatchers {}
}
declare module 'vitest' {
// @ts-expect-error We need to extend the TestAPI interface
export interface TestAPI {
extend: <T>(matchers: Record<string, (this: T, ...args: any[]) => any>) => void;
}
}