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

Function getPromiseMatcher

packages/expect/src/index.ts:92–103  ·  view source on GitHub ↗
(name: string, matcher: RawMatcherFn)

Source from the content-addressed store, hash-verified

90};
91
92const getPromiseMatcher = (name: string, matcher: RawMatcherFn) => {
93 if (name === 'toThrow') {
94 return createThrowMatcher(name, true);
95 } else if (
96 name === 'toThrowErrorMatchingSnapshot' ||
97 name === 'toThrowErrorMatchingInlineSnapshot'
98 ) {
99 return createToThrowErrorMatchingSnapshotMatcher(matcher);
100 }
101
102 return null;
103};
104
105export const expect: Expect = (actual: any, ...rest: Array<any>) => {
106 if (rest.length > 0) {

Callers 1

expectFunction · 0.85

Tested by

no test coverage detected