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

Function testExtendedPropertiesWithCustomOno

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

Source from the content-addressed store, hash-verified

74
75
76export function testExtendedPropertiesWithCustomOno() {
77 let customOno = new Ono(CustomErrorClass);
78 let error = customOno({ foo: 123, bar: true });
79
80 // Error props
81 error.name = "string";
82 error.message = "string";
83 error.stack = "string";
84
85 // CustomErrorClass props
86 error.isValid = true;
87
88 // OnoError props
89 error.toJSON();
90 error[inspect.custom]();
91
92 // Extended props
93 error.foo = 123;
94 error.bar = true;
95 error.toJSON().foo = 123;
96 error.toJSON().bar = true;
97 error[inspect.custom]().foo = 123;
98 error[inspect.custom]().bar = true;
99}
100
101
102export function testOnoConstructorWithoutNew() {

Callers

nothing calls this directly

Calls 1

toJSONMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…