fix(plugin): guard kubernetes upload edge cases
This commit is contained in:
@@ -2,6 +2,7 @@ import { describe, it, expect } from "vitest";
|
||||
import plugin, {
|
||||
buildSandboxExecCommand,
|
||||
buildSandboxExecShellCommand,
|
||||
deriveUploadTargetDir,
|
||||
extractAdapterEnvFromProcess,
|
||||
} from "../../src/plugin.js";
|
||||
|
||||
@@ -179,4 +180,10 @@ describe("plugin", () => {
|
||||
}),
|
||||
).toEqual(["/bin/sh", "-lc", "pnpm test -- --runInBand"]);
|
||||
});
|
||||
|
||||
it("derives upload target directories for root and nested paths", () => {
|
||||
expect(deriveUploadTargetDir("/file")).toBe("/");
|
||||
expect(deriveUploadTargetDir("/workspace/file")).toBe("/workspace");
|
||||
expect(deriveUploadTargetDir("relative-file")).toBe(".");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user