@@ -14,42 +14,41 @@ import { fileExists, pathDoNotExists } from "../../verify.ts";
1414import { testRender } from "./render.ts" ;
1515import 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