UNPKG

@jawis/jates

Version:
68 lines (67 loc) 1.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ClientComController = void 0; /** * */ class ClientComController { constructor(deps) { this.deps = deps; this.onTestRunnerStarts = () => { this.notifyIsRunning(true); }; this.onTestRunnerStops = () => { this.notifyIsRunning(false); }; this.notifyIsRunning = (running) => { this.deps.wsPool.send({ type: "IsRunning", data: running, }); }; this.onTestStarts = (testId) => { this.deps.wsPool.send({ type: "TestCaseStarts", data: testId, }); }; /** * */ this.onTestReport = (report) => { this.sendTestReport({ id: report.id, status: report.status, testLogs: report.zippedTestLogs, }); }; /** * sends TestReport to client. It's only a subset of the information. */ this.sendTestReport = (report) => { this.deps.wsPool.send({ type: "TestReport", data: report, }); }; /** * */ this.onTestSelectionReady = (tests) => { this.deps.wsPool.send({ type: "TestSelection", data: tests, }); }; /** * */ this.onRogueTest = (data) => { this.deps.wsPool.send({ type: "OnRogue", data, }); }; } } exports.ClientComController = ClientComController;