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

Function testOnoConstructorWithoutNew

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

Source from the content-addressed store, hash-verified

100
101
102export function testOnoConstructorWithoutNew() {
103 // eslint-disable-next-line new-cap
104 let customOno = Ono(CustomErrorClass);
105 let error = customOno(message, param1, param2);
106
107 // Error props
108 error.name = "string";
109 error.message = "string";
110 error.stack = "string";
111
112 // OnoError props
113 error.toJSON();
114 error[inspect.custom]();
115
116 // CustomErrorClass props
117 error.isValid = true;
118 error.toJSON().isValid = true;
119 error[inspect.custom]().isValid = true;
120}
121
122
123export function testOnoConstructorWithNew() {

Callers

nothing calls this directly

Calls 2

toJSONMethod · 0.65
OnoInterface · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…