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

Function testOnoConstructorWithNonErrorClass

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

Source from the content-addressed store, hash-verified

141
142
143export function testOnoConstructorWithNonErrorClass() {
144 let customOno = new Ono(CustomClass);
145 let error = customOno(message, param1, param2);
146
147 // Error props
148 error.name = "string";
149 error.message = "string";
150 error.stack = "string";
151
152 // OnoError props
153 error.toJSON();
154 error[inspect.custom]();
155
156 // CustomClass props
157 error.code = 12345;
158 error.toJSON().code = 12345;
159 error[inspect.custom]().code = 12345;
160}
161
162
163export function testOnoToJSON() {

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…