Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions expect/_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ export interface Expected<IsAsync = false> {
toBeCalledWith(...expected: unknown[]): void;

/**
* Asserts that the value is close to the specified number within a tolerance.
* Asserts that a given numerical value is approximately equal to an
* expected number within a within a certain margin of error
* (tolerance). Useful when comparing floating-point numbers, which
* may be represented internally with precision errors.
*
* @example Usage
* ```ts
Expand All @@ -189,7 +192,8 @@ export interface Expected<IsAsync = false> {
* ```
*
* @param candidate The candidate number.
* @param tolerance The tolerance value (optional).
* @param tolerance The number of significant decimal digits to
* consider when comparing the values (optional, default 2).
*/
toBeCloseTo(candidate: number, tolerance?: number): void;

Expand Down
Loading