Skip to content

Commit 866fd8d

Browse files
committed
Don't make test conditional on windows.
1 parent e0998fa commit 866fd8d

File tree

1 file changed

+34
-35
lines changed

1 file changed

+34
-35
lines changed

tests/smoke/render/render-output-dir.test.ts

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,41 @@ import { fileExists, pathDoNotExists } from "../../verify.ts";
1414
import { testRender } from "./render.ts";
1515
import type { Verify } from "../../test.ts";
1616

17-
if (isWindows) {
18-
const inputDir = docs("render-output-dir/");
19-
const quartoDir = ".quarto";
20-
const outputDir = "output-test-dir";
2117

22-
const cleanupDirs = async () => {
23-
if (existsSync(outputDir)) {
24-
safeRemoveSync(outputDir, { recursive: true });
25-
}
26-
if (existsSync(quartoDir)) {
27-
safeRemoveSync(quartoDir, { recursive: true });
28-
}
29-
};
18+
const inputDir = docs("render-output-dir/");
19+
const quartoDir = ".quarto";
20+
const outputDir = "output-test-dir";
3021

31-
const testOutputDirRender = (
32-
quartoVerify: Verify,
33-
extraArgs: string[] = [],
34-
) => {
35-
testRender(
36-
"test.qmd",
37-
"html",
38-
false,
39-
[quartoVerify],
40-
{
41-
cwd: () => inputDir,
42-
setup: cleanupDirs,
43-
teardown: cleanupDirs,
44-
},
45-
["--output-dir", outputDir, ...extraArgs],
46-
outputDir,
47-
);
48-
};
22+
const cleanupDirs = async () => {
23+
if (existsSync(outputDir)) {
24+
safeRemoveSync(outputDir, { recursive: true });
25+
}
26+
if (existsSync(quartoDir)) {
27+
safeRemoveSync(quartoDir, { recursive: true });
28+
}
29+
};
4930

50-
// Test 1: Default behavior (clean=true) - .quarto should be removed
51-
testOutputDirRender(pathDoNotExists(quartoDir));
31+
const testOutputDirRender = (
32+
quartoVerify: Verify,
33+
extraArgs: string[] = [],
34+
) => {
35+
testRender(
36+
"test.qmd",
37+
"html",
38+
false,
39+
[quartoVerify],
40+
{
41+
cwd: () => inputDir,
42+
setup: cleanupDirs,
43+
teardown: cleanupDirs,
44+
},
45+
["--output-dir", outputDir, ...extraArgs],
46+
outputDir,
47+
);
48+
};
5249

53-
// Test 2: With --no-clean flag - .quarto should be preserved
54-
testOutputDirRender(fileExists(quartoDir), ["--no-clean"]);
55-
}
50+
// Test 1: Default behavior (clean=true) - .quarto should be removed
51+
testOutputDirRender(pathDoNotExists(quartoDir));
52+
53+
// Test 2: With --no-clean flag - .quarto should be preserved
54+
testOutputDirRender(fileExists(quartoDir), ["--no-clean"]);

0 commit comments

Comments
 (0)