mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-19 13:32:17 +08:00
Correct Jest toBeCloseTo signature
In Jest .toBeCloseTo's second parameter is optional with a default of 5. See: https://facebook.github.io/jest/docs/api.html#tobeclosetonumber-numdigits This updates the type definition to make this parameter optional as well.
This commit is contained in:
2
jest/index.d.ts
vendored
2
jest/index.d.ts
vendored
@@ -117,7 +117,7 @@ declare namespace jest {
|
||||
toBe(expected: any): void;
|
||||
toBeCalled(): void;
|
||||
toBeCalledWith(...args: any[]): void;
|
||||
toBeCloseTo(expected: number, delta: number): void;
|
||||
toBeCloseTo(expected: number, delta?: number): void;
|
||||
toBeDefined(): void;
|
||||
toBeFalsy(): void;
|
||||
toBeGreaterThan(expected: number): void;
|
||||
|
||||
@@ -147,6 +147,10 @@ describe('compartion', function () {
|
||||
it('works sanely with simple decimals', function () {
|
||||
expect(0.2 + 0.1).toBeCloseTo(0.3, 5);
|
||||
});
|
||||
|
||||
it('works sanely with simple decimals and the default delta', function () {
|
||||
expect(0.2 + 0.1).toBeCloseTo(0.3);
|
||||
});
|
||||
});
|
||||
|
||||
describe('toThrow API', function () {
|
||||
|
||||
Reference in New Issue
Block a user