




















@@ -4,6 +4,7 @@ import os from "node:os";
44import path from "node:path";
55import { describe, expect, it, vi } from "vitest";
66import { runQaDockerUp } from "./docker-up.runtime.js";
7+import { shellQuote } from "./shell-quote.js";
7889type QaDockerUpDeps = NonNullable<Parameters<typeof runQaDockerUp>[1]>;
910@@ -21,10 +22,6 @@ function createHealthyDockerDeps(calls: string[]): QaDockerUpDeps {
2122};
2223}
232424-function quoteForShell(value: string) {
25-return `'${value.replaceAll("'", `'"'"'`)}'`;
26-}
27-2825describe("runQaDockerUp", () => {
2926it("builds the QA UI, writes the harness, starts compose, and waits for health", async () => {
3027const calls: string[] = [];
@@ -72,7 +69,7 @@ describe("runQaDockerUp", () => {
7269expect(result.qaLabUrl).toBe("http://127.0.0.1:43124");
7370expect(result.gatewayUrl).toBe("http://127.0.0.1:18889/");
7471expect(result.composeFile).toBe(composeFile);
75-expect(result.stopCommand).toBe(`docker compose -f ${quoteForShell(composeFile)} down`);
72+expect(result.stopCommand).toBe(`docker compose -f ${shellQuote(composeFile)} down`);
7673} finally {
7774await rm(outputDir, { recursive: true, force: true });
7875}
@@ -96,7 +93,7 @@ describe("runQaDockerUp", () => {
9693createHealthyDockerDeps(calls),
9794);
989599-expect(result.stopCommand).toBe(`docker compose -f ${quoteForShell(composeFile)} down`);
96+expect(result.stopCommand).toBe(`docker compose -f ${shellQuote(composeFile)} down`);
10097expect(calls).toContain(
10198`docker compose -f ${composeFile} down --remove-orphans @${repoRoot}`,
10299);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。