mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 07:11:25 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -6,7 +6,9 @@ describe("getShellPathFromLoginShell", () => {
|
||||
afterEach(() => resetShellPathCacheForTests());
|
||||
|
||||
it("returns PATH from login shell env", () => {
|
||||
if (process.platform === "win32") return;
|
||||
if (process.platform === "win32") {
|
||||
return;
|
||||
}
|
||||
const exec = vi
|
||||
.fn()
|
||||
.mockReturnValue(Buffer.from("PATH=/custom/bin\0HOME=/home/user\0", "utf-8"));
|
||||
@@ -15,7 +17,9 @@ describe("getShellPathFromLoginShell", () => {
|
||||
});
|
||||
|
||||
it("caches the value", () => {
|
||||
if (process.platform === "win32") return;
|
||||
if (process.platform === "win32") {
|
||||
return;
|
||||
}
|
||||
const exec = vi.fn().mockReturnValue(Buffer.from("PATH=/custom/bin\0", "utf-8"));
|
||||
const env = { SHELL: "/bin/sh" } as NodeJS.ProcessEnv;
|
||||
expect(getShellPathFromLoginShell({ env, exec })).toBe("/custom/bin");
|
||||
@@ -24,7 +28,9 @@ describe("getShellPathFromLoginShell", () => {
|
||||
});
|
||||
|
||||
it("returns null on exec failure", () => {
|
||||
if (process.platform === "win32") return;
|
||||
if (process.platform === "win32") {
|
||||
return;
|
||||
}
|
||||
const exec = vi.fn(() => {
|
||||
throw new Error("boom");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user