MCPcopy Create free account
hub / github.com/JS-DevTools/ono / testExtendedPropertiesWithOriginalError

Function testExtendedPropertiesWithOriginalError

test/specs/typescript.spec.ts:51–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50
51export function testExtendedPropertiesWithOriginalError() {
52 let error = ono(customError, { foo: 123, bar: true });
53
54 // Error props
55 error.name = "string";
56 error.message = "string";
57 error.stack = "string";
58
59 // customError props
60 error.isValid = true;
61
62 // OnoError props
63 error.toJSON();
64 error[inspect.custom]();
65
66 // Extended props
67 error.foo = 123;
68 error.bar = true;
69 error.toJSON().foo = 123;
70 error.toJSON().bar = true;
71 error[inspect.custom]().foo = 123;
72 error[inspect.custom]().bar = true;
73}
74
75
76export function testExtendedPropertiesWithCustomOno() {

Callers

nothing calls this directly

Calls 2

toJSONMethod · 0.65
onoFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…