import { afterEach, describe, expect, it } from "vitest"; import { configRuns, describeResultFolders, describeServerPorts, hold, itExitsWhenItsPortIsTaken, itKeepsTheViteCacheInTheRun, portOf, releaseRuns, } from "../helpers/playwright-run-isolation.ts"; /** * 1105/12-04 for the capabilities config; why each check exists is in * tests/unit/playwright-run-isolation.test.ts. * * 1106/10-01. This config goes with the browser file/storage runtime: * test:browser-file-storage-removal deletes it, and deletes this file by * name with it. Its eight checks used to sit with the other configs and were * defined only while `existsSync` found the config. test:unit fails on a * skipped test (1101/10-04), but a test that is never defined is not * reported: the checks left that drill's copy unnoticed, and a renamed config * would have taken them out of the template the same way. Imported by name, a * renamed config fails check:types and this file instead. */ const runs = configRuns({ capabilities: () => import("../../playwright.capabilities.config.ts"), visual: () => import("../../playwright.visual.config.ts"), }); afterEach(releaseRuns); describeResultFolders(runs, [["capabilities", "browser-capabilities"]]); describe("the build a run serves", () => { itKeepsTheViteCacheInTheRun(runs, ["capabilities"]); }); describeServerPorts(runs, ["capabilities"]); describe("vite servers", () => { itExitsWhenItsPortIsTaken(runs, ["capabilities"]); it("no longer share one port between the visual preview and the capability dev server", async () => { const visual = portOf(await runs.load("visual")); await hold(visual); expect(portOf(await runs.load("capabilities"))).not.toBe(visual); }); });