From 0036299887aa0c65a7bc012f7e6d0e7b713b9ace Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 20:25:58 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- src/js/internal-for-testing.ts | 2 +- test/js/bun/shell/commands/cp.test.ts | 4 ++-- test/js/bun/shell/test_builder.ts | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/js/internal-for-testing.ts b/src/js/internal-for-testing.ts index e1b14471f87c9..0ca66c84c3ce3 100644 --- a/src/js/internal-for-testing.ts +++ b/src/js/internal-for-testing.ts @@ -28,5 +28,5 @@ export const shellInternals = { * const isDisabled = builtinDisabled("cp") * ``` */ - builtinDisabled: $newZigFunction("shell.zig", "TestingAPIs.disabledOnThisPlatform", 1) + builtinDisabled: $newZigFunction("shell.zig", "TestingAPIs.disabledOnThisPlatform", 1), }; diff --git a/test/js/bun/shell/commands/cp.test.ts b/test/js/bun/shell/commands/cp.test.ts index 28c953b91195a..4100d87d264dc 100644 --- a/test/js/bun/shell/commands/cp.test.ts +++ b/test/js/bun/shell/commands/cp.test.ts @@ -5,9 +5,9 @@ import { sortedShellOutput } from "../util"; import { tempDirWithFiles } from "harness"; import fs from "fs"; import { shellInternals } from "bun:internal-for-testing"; -const { builtinDisabled } = shellInternals +const { builtinDisabled } = shellInternals; -const p = process.platform === 'win32' ? (s: string) => s.replaceAll('/', '\\') : (s: string) => s; +const p = process.platform === "win32" ? (s: string) => s.replaceAll("/", "\\") : (s: string) => s; // const p = (s: string) => s; describe.if(!builtinDisabled("cp"))("bunshell cp", async () => { diff --git a/test/js/bun/shell/test_builder.ts b/test/js/bun/shell/test_builder.ts index 23e292d46a20e..64497203de297 100644 --- a/test/js/bun/shell/test_builder.ts +++ b/test/js/bun/shell/test_builder.ts @@ -20,7 +20,7 @@ export class TestBuilder { private tempdir: string | undefined = undefined; private _env: { [key: string]: string } | undefined = undefined; - private _cwd: string | undefined = undefined + private _cwd: string | undefined = undefined; private __todo: boolean | string = false; @@ -58,7 +58,7 @@ export class TestBuilder { cwd(path: string): this { this._cwd = path; - return this + return this; } directory(path: string): this { @@ -137,7 +137,7 @@ export class TestBuilder { */ ensureTempDir(str?: string): this { if (str !== undefined) { - this.setTempdir(str) + this.setTempdir(str); } else this.getTempDir(); return this; @@ -212,10 +212,10 @@ export class TestBuilder { return undefined; } - let finalPromise = this.promise.val + let finalPromise = this.promise.val; if (this._cwd) finalPromise = finalPromise.cwd(this._cwd); if (this._env) finalPromise = finalPromise.env(this._env); - const output = await finalPromise + const output = await finalPromise; const { stdout, stderr, exitCode } = output!; const tempdir = this.tempdir || "NO_TEMP_DIR"; @@ -229,15 +229,15 @@ export class TestBuilder { if (this.expected_stderr !== undefined) { if (typeof this.expected_stderr === "string") { expect(stderr.toString()).toEqual(this.expected_stderr.replaceAll("$TEMP_DIR", tempdir)); - } else if (typeof this.expected_stderr === 'function') { + } else if (typeof this.expected_stderr === "function") { this.expected_stderr(stderr.toString(), tempdir); } else { - expect(stderr.toString()).toContain(this.expected_stderr.contains) + expect(stderr.toString()).toContain(this.expected_stderr.contains); } } if (this.expected_exit_code !== undefined) expect(exitCode).toEqual(this.expected_exit_code); - console.log('Checking files') + console.log("Checking files"); for (const [filename, expected] of Object.entries(this.file_equals)) { const actual = await Bun.file(join(this.tempdir!, filename)).text(); expect(actual).toEqual(expected);