(context: WebSmokeContext, opened: boolean)
| 220 | } |
| 221 | |
| 222 | async function cleanupWebSmoke(context: WebSmokeContext, opened: boolean): Promise<void> { |
| 223 | const errors: unknown[] = []; |
| 224 | if (opened) { |
| 225 | try { |
| 226 | await runStep(context, 'close web session', ['close', ...context.common], 0); |
| 227 | } catch (error) { |
| 228 | errors.push(error); |
| 229 | } |
| 230 | } |
| 231 | try { |
| 232 | await closeServer(context.server); |
| 233 | } catch (error) { |
| 234 | errors.push(error); |
| 235 | } |
| 236 | if (errors.length === 1) { |
| 237 | throw errors[0]; |
| 238 | } |
| 239 | if (errors.length > 1) { |
| 240 | throw new AggregateError(errors, 'web smoke cleanup failed'); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | function recordStep( |
| 245 | context: WebSmokeContext, |
no test coverage detected