Test the error message to include a specific message. @param message - Message that should be included in the error.
(message: string)
| 38 | @param message - Message that should be included in the error. |
| 39 | */ |
| 40 | messageIncludes(message: string): this { |
| 41 | return this.addValidator({ |
| 42 | message: (error, label) => `Expected ${label} message to include \`${message}\`, got \`${error.message}\``, |
| 43 | validator: error => error.message.includes(message), |
| 44 | }); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | Test the error object to have specific keys. |
no test coverage detected