diff --git a/backend/api.js b/backend/api.js index d9fd8d6..a7b9937 100644 --- a/backend/api.js +++ b/backend/api.js @@ -12,7 +12,6 @@ import * as util from "./util.js"; import { bash, getUUID, logError } from "./util.js"; const allSessions = new Set(); -const TEST_RUN_FINISHED = "Test run finished!"; export class Session { get homedir() { return "/home/riju/src"; @@ -235,7 +234,6 @@ export class Session { break; } await this.runCode(msg.code, msg.expectedOutput); - this.term.pty.stdin.write(TEST_RUN_FINISHED); break; case "formatCode": if (typeof msg.code !== "string") { diff --git a/frontend/src/app.js b/frontend/src/app.js index 4c7e5ec..ee3b17e 100644 --- a/frontend/src/app.js +++ b/frontend/src/app.js @@ -150,11 +150,8 @@ async function main() { return; } term.write(message.output); - testData.push(message.output); - - if (testData.join("").includes("Test run finished!")) { - postTestResults(testData, message.expectedOutput); - testData = []; + if (message.expectedOutput) { + testData.push(message.output); } return; case "lspStopped": @@ -201,6 +198,12 @@ async function main() { serviceLogLines[message.service] = lines; return; case "serviceFailed": + if (message.expectedOutput) { + postTestResults(testData, message.expectedOutput); + } + + testData = []; + if ( typeof message.service !== "string" || typeof message.error !== "string"