( operator: string | null, operatorName: string, expected: unknown, )
| 63 | : ''; |
| 64 | |
| 65 | const assertMatcherHint = ( |
| 66 | operator: string | null, |
| 67 | operatorName: string, |
| 68 | expected: unknown, |
| 69 | ) => { |
| 70 | let message = ''; |
| 71 | |
| 72 | if (operator === '==' && expected === true) { |
| 73 | message = |
| 74 | chalk.dim('assert') + |
| 75 | chalk.dim('(') + |
| 76 | chalk.red('received') + |
| 77 | chalk.dim(')'); |
| 78 | } else if (operatorName) { |
| 79 | message = |
| 80 | chalk.dim('assert') + |
| 81 | chalk.dim(`.${operatorName}(`) + |
| 82 | chalk.red('received') + |
| 83 | chalk.dim(', ') + |
| 84 | chalk.green('expected') + |
| 85 | chalk.dim(')'); |
| 86 | } |
| 87 | |
| 88 | return message; |
| 89 | }; |
| 90 | |
| 91 | function assertionErrorMessage( |
| 92 | error: AssertionErrorWithStack, |
no outgoing calls
no test coverage detected