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 Decimal, { DecimalSource, format } from "util/bignum";
|
||||||
import { expect } from "vitest";
|
import { expect, Assertion } from "vitest";
|
||||||
|
|
||||||
interface CustomMatchers<R = unknown> {
|
interface CustomMatchers<R = unknown> {
|
||||||
compare_tolerance(expected: DecimalSource, tolerance?: number): R;
|
compare_tolerance(expected: DecimalSource, tolerance?: number): R;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare module "vitest" {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||||
namespace Vi {
|
interface Assertion extends CustomMatchers {}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||||
interface Assertion extends CustomMatchers {}
|
interface AsymmetricMatchersContaining extends CustomMatchers {}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
||||||
interface AsymmetricMatchersContaining extends CustomMatchers {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
expect.extend({
|
expect.extend({
|
||||||
|
|
Loading…
Reference in a new issue