| 27 | |
| 28 | |
| 29 | export function testExtendedProperties() { |
| 30 | let error = ono({ foo: 123, bar: true }); |
| 31 | |
| 32 | // Error props |
| 33 | error.name = "string"; |
| 34 | error.message = "string"; |
| 35 | error.stack = "string"; |
| 36 | |
| 37 | // OnoError props |
| 38 | error.toJSON(); |
| 39 | error[inspect.custom](); |
| 40 | |
| 41 | // Extended props |
| 42 | error.foo = 123; |
| 43 | error.bar = true; |
| 44 | error.toJSON().foo = 123; |
| 45 | error.toJSON().bar = true; |
| 46 | error[inspect.custom]().foo = 123; |
| 47 | error[inspect.custom]().bar = true; |
| 48 | } |
| 49 | |
| 50 | |
| 51 | export function testExtendedPropertiesWithOriginalError() { |