test: tighten docs link audit invocations

This commit is contained in:
Peter Steinberger
2026-05-09 20:51:53 +01:00
parent 3dfbf5af43
commit 9bf5f52a19

View File

@@ -177,10 +177,10 @@ describe("docs-link-audit", () => {
expect(invocation).toEqual({
command: "pnpm",
args: ["dlx", "mint", "broken-links", "--check-anchors"],
options: expect.objectContaining({
stdio: "inherit",
options: {
cwd: anchorDocsDir,
}),
stdio: "inherit",
},
});
expect(cleanedDir).toBe(anchorDocsDir);
});
@@ -212,7 +212,10 @@ describe("docs-link-audit", () => {
expect(exitCode).toBe(0);
expect(invocations).toHaveLength(2);
const [versionCheck, linkCheck] = invocations;
expect(versionCheck).toMatchObject({
if (!versionCheck || !linkCheck) {
throw new Error("Expected Mintlify wrapper invocations");
}
expect(versionCheck).toEqual({
command: "fnm",
args: [
"exec",
@@ -221,15 +224,13 @@ describe("docs-link-audit", () => {
"-e",
"process.exit(Number(process.versions.node.split('.')[0]) === 22 ? 0 : 1)",
],
options: { stdio: "ignore" },
options: { cwd: anchorDocsDir, stdio: "ignore" },
});
expect(linkCheck).toMatchObject({
expect(linkCheck).toEqual({
command: "fnm",
args: ["exec", "--using=22", "pnpm", "dlx", "mint", "broken-links", "--check-anchors"],
options: { stdio: "inherit" },
options: { cwd: anchorDocsDir, stdio: "inherit" },
});
expect(versionCheck.options.cwd).toBe(anchorDocsDir);
expect(linkCheck.options.cwd).toBe(anchorDocsDir);
expect(cleanedDir).toBe(anchorDocsDir);
});
});