test: tighten docs audit invocation assertions

This commit is contained in:
Shakker
2026-05-08 20:56:08 +01:00
parent 76b5ea5775
commit 4b913dc347

View File

@@ -211,7 +211,8 @@ describe("docs-link-audit", () => {
expect(exitCode).toBe(0);
expect(invocations).toHaveLength(2);
expect(invocations[0]).toMatchObject({
const [versionCheck, linkCheck] = invocations;
expect(versionCheck).toMatchObject({
command: "fnm",
args: [
"exec",
@@ -222,13 +223,13 @@ describe("docs-link-audit", () => {
],
options: { stdio: "ignore" },
});
expect(invocations[1]).toMatchObject({
expect(linkCheck).toMatchObject({
command: "fnm",
args: ["exec", "--using=22", "pnpm", "dlx", "mint", "broken-links", "--check-anchors"],
options: { stdio: "inherit" },
});
expect(invocations[0]?.options.cwd).toBe(anchorDocsDir);
expect(invocations[1]?.options.cwd).toBe(anchorDocsDir);
expect(versionCheck.options.cwd).toBe(anchorDocsDir);
expect(linkCheck.options.cwd).toBe(anchorDocsDir);
expect(cleanedDir).toBe(anchorDocsDir);
});
});