| 100 | |
| 101 | |
| 102 | export 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 | |
| 123 | export function testOnoConstructorWithNew() { |