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

Method getExpectedType

packages/expect/src/asymmetricMatchers.ts:144–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

142 }
143
144 override getExpectedType() {
145 if (this.sample === String) {
146 return 'string';
147 }
148
149 if (this.sample === Number) {
150 return 'number';
151 }
152
153 if (this.sample === Function) {
154 return 'function';
155 }
156
157 if (this.sample === Object) {
158 return 'object';
159 }
160
161 if (this.sample === Boolean) {
162 return 'boolean';
163 }
164
165 if (this.sample === Array) {
166 return 'array';
167 }
168
169 return fnNameFor(this.sample);
170 }
171
172 override toAsymmetricMatcher() {
173 return `Any<${fnNameFor(this.sample)}>`;

Callers 1

diffFunction · 0.45

Calls 1

fnNameForFunction · 0.70

Tested by

no test coverage detected