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

Method name

source/predicates/error.ts:16–21  ·  view source on GitHub ↗

Test an error to have a specific name. @param expected - Expected name of the Error.

(expected: string)

Source from the content-addressed store, hash-verified

14 @param expected - Expected name of the Error.
15 */
16 name(expected: string): this {
17 return this.addValidator({
18 message: (error, label) => `Expected ${label} to have name \`${expected}\`, got \`${error.name}\``,
19 validator: error => error.name === expected,
20 });
21 }
22
23 /**
24 Test an error to have a specific message.

Callers 1

error.tsFile · 0.80

Calls 1

addValidatorMethod · 0.80

Tested by

no test coverage detected