MCPcopy
hub / github.com/jestjs/jest / asymmetricMatch

Method asymmetricMatch

packages/expect/src/asymmetricMatchers.ts:229–238  ·  view source on GitHub ↗
(other: unknown)

Source from the content-addressed store, hash-verified

227
228class ArrayOf extends AsymmetricMatcher<unknown> {
229 asymmetricMatch(other: unknown) {
230 const matcherContext = this.getMatcherContext();
231 const result =
232 Array.isArray(other) &&
233 other.every(item =>
234 equals(this.sample, item, matcherContext.customTesters),
235 );
236
237 return this.inverse ? !result : result;
238 }
239
240 toString() {
241 return `${this.inverse ? 'Not' : ''}ArrayOf`;

Callers

nothing calls this directly

Calls 1

equalsFunction · 0.90

Tested by

no test coverage detected