fix(qa): accept pnpm separator for lab up (#96246)

This commit is contained in:
Vincent Koc
2026-06-24 10:22:56 +08:00
committed by GitHub
parent ce0142f04e
commit d42b864219
2 changed files with 15 additions and 1 deletions

View File

@@ -33,8 +33,9 @@ Options:
}
function parseQaLabUpArgs(argv: readonly string[]) {
const args = argv[0] === "--" ? argv.slice(1) : argv;
return parseArgs({
args: [...argv],
args: [...args],
options,
allowPositionals: false,
}).values;

View File

@@ -34,6 +34,19 @@ describe("scripts/qa-lab-up", () => {
);
});
it("accepts the pnpm run argument separator", async () => {
const runQaDockerUpCommand = vi.fn(async () => {});
const loadRuntime = vi.fn(async () => ({ runQaDockerUpCommand }));
await expect(
qaLabUpTesting.runQaLabUp(["--", "--gateway-port", "4100"], { loadRuntime }),
).resolves.toBe(0);
expect(runQaDockerUpCommand).toHaveBeenCalledWith(
expect.objectContaining({ gatewayPort: 4100 }),
);
});
it("accepts the maximum TCP port before loading the Docker runtime", async () => {
const runQaDockerUpCommand = vi.fn(async () => {});
const loadRuntime = vi.fn(async () => ({ runQaDockerUpCommand }));