(message = '', options = {}, noStack = false)
| 142 | |
| 143 | // Create errors with properties to be used in tests |
| 144 | const err = (message = '', options = {}, noStack = false) => { |
| 145 | const e = Object.assign( |
| 146 | new Error(message), |
| 147 | typeof options !== 'object' ? { code: options } : options |
| 148 | ) |
| 149 | e.stack = options.stack || `Error: ${message}` |
| 150 | if (noStack) { |
| 151 | delete e.stack |
| 152 | } |
| 153 | return e |
| 154 | } |
| 155 | |
| 156 | t.test('handles unknown error with logs and debug file', async (t) => { |
| 157 | const { exitHandler, debugFile, logs } = await mockExitHandler(t, { |