File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,10 @@ export interface Expected<IsAsync = false> {
177177 toBeCalledWith ( ...expected : unknown [ ] ) : void ;
178178
179179 /**
180- * Asserts that the value is close to the specified number within a tolerance.
180+ * Asserts that a given numerical value is approximately equal to an
181+ * expected number within a certain margin of error
182+ * (tolerance). Useful when comparing floating-point numbers, which
183+ * may be represented internally with precision errors.
181184 *
182185 * @example Usage
183186 * ```ts
@@ -189,7 +192,8 @@ export interface Expected<IsAsync = false> {
189192 * ```
190193 *
191194 * @param candidate The candidate number.
192- * @param tolerance The tolerance value (optional).
195+ * @param tolerance The number of significant decimal digits to
196+ * consider when comparing the values (optional, default 2).
193197 */
194198 toBeCloseTo ( candidate : number , tolerance ?: number ) : void ;
195199
You can’t perform that action at this time.
0 commit comments