forked from profectus/Profectus
fix augmentation of vitest Assertion interface
The `Vi` namespace no longer exists since vitest 0.31.0. Using module augmentation is the new way.
This commit is contained in:
parent
cdc035b5bd
commit
6540546432
1 changed files with 6 additions and 9 deletions
|
@ -1,18 +1,15 @@
|
|||
import Decimal, { DecimalSource, format } from "util/bignum";
|
||||
import { expect } from "vitest";
|
||||
import { expect, Assertion } from "vitest";
|
||||
|
||||
interface CustomMatchers<R = unknown> {
|
||||
compare_tolerance(expected: DecimalSource, tolerance?: number): R;
|
||||
}
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace Vi {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
interface Assertion extends CustomMatchers {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
interface AsymmetricMatchersContaining extends CustomMatchers {}
|
||||
}
|
||||
declare module "vitest" {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
interface Assertion extends CustomMatchers {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
interface AsymmetricMatchersContaining extends CustomMatchers {}
|
||||
}
|
||||
|
||||
expect.extend({
|
||||
|
|
Loading…
Reference in a new issue