vitest
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -6,1 +6,26 @@ export * from './types'; | ||
export * from './integrations/sinon'; | ||
declare global { | ||
namespace Chai { | ||
interface Assertion { | ||
toMatchSnapshot(message?: string): Assertion; | ||
matchSnapshot(message?: string): Assertion; | ||
toEqual(expected: any): void; | ||
toStrictEqual(expected: any): void; | ||
toBe(expected: any): void; | ||
toContain(item: any): void; | ||
toBeTruthy(): void; | ||
toBeFalsy(): void; | ||
toBeNaN(): void; | ||
toBeUndefined(): void; | ||
toBeNull(): void; | ||
toBeDefined(): void; | ||
toBeInstanceOf(c: any): void; | ||
toBeCalledTimes(n: number): void; | ||
toBeCalledOnce(): void; | ||
toBeCalled(): void; | ||
} | ||
interface ExpectStatic { | ||
addSnapshotSerializer: import('pretty-format').Plugin; | ||
} | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable @typescript-eslint/no-namespace */ | ||
export * from './types'; | ||
@@ -2,0 +3,0 @@ export * from './suite'; |
import { ChaiPlugin } from './types'; | ||
export declare function JestChaiExpect(): ChaiPlugin; | ||
declare global { | ||
namespace Chai { | ||
interface Assertion { | ||
toEqual(expected: any): void; | ||
toStrictEqual(expected: any): void; | ||
toBe(expected: any): void; | ||
toContain(item: any): void; | ||
toBeTruthy(): void; | ||
toBeFalsy(): void; | ||
toBeNaN(): void; | ||
toBeUndefined(): void; | ||
toBeNull(): void; | ||
toBeDefined(): void; | ||
} | ||
interface ExpectStatic { | ||
addSnapshotSerializer: import('pretty-format').Plugin; | ||
} | ||
} | ||
} |
@@ -13,3 +13,3 @@ // Jest Expect Compact | ||
utils.addMethod(proto, 'toBe', function (expected) { | ||
return this.be(expected); | ||
return this.equal(expected); | ||
}); | ||
@@ -39,3 +39,16 @@ utils.addMethod(proto, 'toContain', function (item) { | ||
}); | ||
utils.addMethod(proto, 'toBeInstanceOf', function (obj) { | ||
return this.instanceOf(obj); | ||
}); | ||
// mock | ||
utils.addMethod(proto, 'toBeCalledTimes', function (number) { | ||
return this.callCount(number); | ||
}); | ||
utils.addMethod(proto, 'toBeCalledOnce', function () { | ||
return this.callCount(1); | ||
}); | ||
utils.addMethod(proto, 'toBeCalled', function () { | ||
return this.called; | ||
}); | ||
}; | ||
} |
@@ -9,12 +9,1 @@ import { ChaiPlugin } from '../types'; | ||
export declare function SnapshotPlugin(options: SnapshotOptions): Promise<ChaiPlugin>; | ||
declare global { | ||
namespace Chai { | ||
interface Assertion { | ||
toMatchSnapshot(message?: string): Assertion; | ||
matchSnapshot(message?: string): Assertion; | ||
} | ||
interface ExpectStatic { | ||
addSnapshotSerializer: import('pretty-format').Plugin; | ||
} | ||
} | ||
} |
import sinon from 'sinon'; | ||
export { sinon }; | ||
export const { mock, spy, stub } = sinon; | ||
// @ts-expect-error | ||
sinon.fn = sinon.spy; |
{ | ||
"name": "vitest", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
54102
1304
55