MCPcopy
hub / github.com/callstack/agent-device / cleanupWebSmoke

Function cleanupWebSmoke

test/integration/smoke-web-platform.test.ts:222–242  ·  view source on GitHub ↗
(context: WebSmokeContext, opened: boolean)

Source from the content-addressed store, hash-verified

220}
221
222async 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
244function recordStep(
245 context: WebSmokeContext,

Callers 1

runWebSmokeFunction · 0.85

Calls 3

pushMethod · 0.80
runStepFunction · 0.70
closeServerFunction · 0.70

Tested by

no test coverage detected