()
| 121 | |
| 122 | it("should lazily pop Ono off the new error's stack", () => { |
| 123 | function makeError () { |
| 124 | class MyCustomError extends Error { |
| 125 | constructor (message) { |
| 126 | super(message); |
| 127 | |
| 128 | delete this.stack; |
| 129 | let stack = createFakeStack( |
| 130 | { fn: "foo", file: "foo.js", line: 1, col: 1 }, |
| 131 | { fn: "bar", file: "bar.js", line: 100, col: 100 }, |
| 132 | ); |
| 133 | |
| 134 | this.stackHasBeenRead = false; |
| 135 | |
| 136 | Object.defineProperty(this, "stack", { |
| 137 | configurable: true, |
| 138 | get () { |
| 139 | this.stackHasBeenRead = true; |
| 140 | return stack; |
| 141 | }, |
| 142 | }); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | let myCustomOno = new Ono(MyCustomError); |
| 147 | return myCustomOno("Oops, an error happened."); |
| 148 | } |
| 149 | |
| 150 | let error = makeError(); |
| 151 |
no outgoing calls
no test coverage detected
searching dependent graphs…