Path: blob/main/tests/smoke/project/project-ignore-dirs.test.ts
12925 views
/*1* project-ignore-dirs.test.ts2*3* Verifies that engine-specific ignore directories (venv, renv, env, packrat, etc.)4* are properly excluded from project file discovery and rendering.5*6* Copyright (C) 2020-2025 Posit Software, PBC7*/89import { docs } from "../../utils.ts";10import { join } from "../../../src/deno_ral/path.ts";11import { existsSync } from "../../../src/deno_ral/fs.ts";12import { testQuartoCmd } from "../../test.ts";13import { fileExists, noErrors, pathDoNotExists } from "../../verify.ts";1415const renderDir = docs("project/ignore-dirs");16const outDir = join(Deno.cwd(), renderDir);1718// Test that engine ignore directories are properly excluded19testQuartoCmd(20"render",21[renderDir],22[23noErrors,24fileExists(join(outDir, "index.html")), // Control: regular file should be rendered25pathDoNotExists(join(outDir, "venv", "test.html")), // venv (Jupyter) should be ignored26pathDoNotExists(join(outDir, "renv", "test.html")), // renv (Knitr) should be ignored27pathDoNotExists(join(outDir, "env", "test.html")), // env (Jupyter) should be ignored28],29{30teardown: async () => {31// Clean up rendered HTML files32const htmlFiles = [33join(outDir, "index.html"),34join(outDir, "venv", "test.html"),35join(outDir, "renv", "test.html"),36join(outDir, "env", "test.html"),37];38for (const file of htmlFiles) {39if (existsSync(file)) {40await Deno.remove(file);41}42}43},44},45);464748