From ab2737337bf2670cb06cae489cb14c5d0700da18 Mon Sep 17 00:00:00 2001 From: Philipp Fritsche Date: Wed, 14 Dec 2022 10:34:54 +0100 Subject: [PATCH] feat: add `close` method on `TestConductor` --- src/conductor/ChromeTestConductor.ts | 5 ++++- src/conductor/NodeTestConductor.ts | 1 - src/conductor/TestConductor.ts | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/conductor/ChromeTestConductor.ts b/src/conductor/ChromeTestConductor.ts index 6f2e8e0..cbaa802 100644 --- a/src/conductor/ChromeTestConductor.ts +++ b/src/conductor/ChromeTestConductor.ts @@ -1,5 +1,4 @@ import puppeteer from 'puppeteer-core' -import { ReporterServer } from '../reporter/ReporterServer' import { makeId } from '../test/Entity' import { TestConductor } from './TestConductor' @@ -16,6 +15,10 @@ export class ChromeTestConductor extends TestConductor { ], }) + async close(): Promise { + return (await this.browser).close() + } + protected async runTestSuite( runId: string, testFile: string, diff --git a/src/conductor/NodeTestConductor.ts b/src/conductor/NodeTestConductor.ts index 96585bf..e200083 100644 --- a/src/conductor/NodeTestConductor.ts +++ b/src/conductor/NodeTestConductor.ts @@ -1,5 +1,4 @@ import { spawn } from 'child_process' -import { ReporterServer } from '../reporter/ReporterServer' import { TestConductor } from './TestConductor' const selfUrl = import.meta.url diff --git a/src/conductor/TestConductor.ts b/src/conductor/TestConductor.ts index 822bbbf..fee9c9a 100644 --- a/src/conductor/TestConductor.ts +++ b/src/conductor/TestConductor.ts @@ -80,6 +80,8 @@ export abstract class TestConductor extends Entity { } } + async close() {} + protected abstract runTestSuite( runId: string, testFile: string,