diff options
author | 2023-03-04 17:52:13 -0800 | |
---|---|---|
committer | 2023-03-04 17:52:13 -0800 | |
commit | 9963e1c3d8f062829ec104843f0b140819796b42 (patch) | |
tree | 88c0a04c5c78c8c29744446185b30538ceec384f | |
parent | 9e2f6ef1be877d495d5ddbee6196fb436147f546 (diff) | |
download | bun-9963e1c3d8f062829ec104843f0b140819796b42.tar.gz bun-9963e1c3d8f062829ec104843f0b140819796b42.tar.zst bun-9963e1c3d8f062829ec104843f0b140819796b42.zip |
Update runner.ts
-rw-r--r-- | packages/bun-internal-test/src/runner.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/bun-internal-test/src/runner.ts b/packages/bun-internal-test/src/runner.ts index 2f706fec1..e60057a41 100644 --- a/packages/bun-internal-test/src/runner.ts +++ b/packages/bun-internal-test/src/runner.ts @@ -1,10 +1,12 @@ -import { spawn } from "bun"; -import { readdirSync } from "node:fs"; +import { ArrayBufferSink, spawn } from "bun"; +import { readdirSync, openSync, writeSync, truncateSync } from "node:fs"; import { resolve } from "node:path"; import * as action from "@actions/core"; +import { StringDecoder } from "node:string_decoder"; const cwd = resolve("../.."); process.chdir(cwd); + const isAction = !!process.env["GITHUB_ACTION"]; const errorPattern = /error: ([\S\s]*?)(?=\n.*?at (\/.*):(\d+):(\d+))/gim; @@ -70,7 +72,7 @@ async function runTest(path: string): Promise<void> { let failed = false; function findErrors(data: Uint8Array): void { - const text = new TextDecoder().decode(data); + const text = new StringDecoder().write(new Buffer(data.buffer)); for (const [message, _, path, line, col] of text.matchAll(errorPattern)) { failed = true; action.error(message, { @@ -79,6 +81,7 @@ function findErrors(data: Uint8Array): void { startColumn: parseInt(col), }); } + Bun.gc(true); } const tests = []; |