MCPcopy
hub / github.com/vitest-dev/vitest / constructor

Method constructor

packages/expect/src/jest-asymmetric-matchers.ts:344–356  ·  view source on GitHub ↗
(sample: number, precision = 2, inverse = false)

Source from the content-addressed store, hash-verified

342 private readonly precision: number
343
344 constructor(sample: number, precision = 2, inverse = false) {
345 if (!isA('Number', sample)) {
346 throw new Error('Expected is not a Number')
347 }
348
349 if (!isA('Number', precision)) {
350 throw new Error('Precision is not a Number')
351 }
352
353 super(sample)
354 this.inverse = inverse
355 this.precision = precision
356 }
357
358 asymmetricMatch(other: number) {
359 if (!isA('Number', other)) {

Callers

nothing calls this directly

Calls 1

isAFunction · 0.90

Tested by

no test coverage detected