( expected: unknown, matcherName: string, options?: MatcherHintOptions, )
| 153 | } |
| 154 | |
| 155 | export const ensureNoExpected = ( |
| 156 | expected: unknown, |
| 157 | matcherName: string, |
| 158 | options?: MatcherHintOptions, |
| 159 | ): void => { |
| 160 | if (expected !== undefined) { |
| 161 | // Prepend maybe not only for backward compatibility. |
| 162 | const matcherString = (options ? '' : '[.not]') + matcherName; |
| 163 | throw new Error( |
| 164 | matcherErrorMessage( |
| 165 | matcherHint(matcherString, undefined, '', options), |
| 166 | // Because expected is omitted in hint above, |
| 167 | // expected is black instead of green in message below. |
| 168 | 'this matcher must not have an expected argument', |
| 169 | printWithType('Expected', expected, printExpected), |
| 170 | ), |
| 171 | ); |
| 172 | } |
| 173 | }; |
| 174 | |
| 175 | /** |
| 176 | * Ensures that `actual` is of type `number | bigint` |
no test coverage detected