MCPcopy
hub / github.com/sindresorhus/ow / messageIncludes

Method messageIncludes

source/predicates/error.ts:40–45  ·  view source on GitHub ↗

Test the error message to include a specific message. @param message - Message that should be included in the error.

(message: string)

Source from the content-addressed store, hash-verified

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.

Callers 1

error.tsFile · 0.80

Calls 2

addValidatorMethod · 0.80
includesMethod · 0.45

Tested by

no test coverage detected