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

Function testOnoConstructorWithNew

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

Source from the content-addressed store, hash-verified

121
122
123export function testOnoConstructorWithNew() {
124 let customOno = new Ono(CustomErrorClass);
125 let error = customOno(message, param1, param2);
126
127 // Error props
128 error.name = "string";
129 error.message = "string";
130 error.stack = "string";
131
132 // OnoError props
133 error.toJSON();
134 error[inspect.custom]();
135
136 // CustomErrorClass props
137 error.isValid = true;
138 error.toJSON().isValid = true;
139 error[inspect.custom]().isValid = true;
140}
141
142
143export function testOnoConstructorWithNonErrorClass() {

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…