Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/smoke/project/project-ignore-dirs.test.ts
12925 views
1
/*
2
* project-ignore-dirs.test.ts
3
*
4
* Verifies that engine-specific ignore directories (venv, renv, env, packrat, etc.)
5
* are properly excluded from project file discovery and rendering.
6
*
7
* Copyright (C) 2020-2025 Posit Software, PBC
8
*/
9
10
import { docs } from "../../utils.ts";
11
import { join } from "../../../src/deno_ral/path.ts";
12
import { existsSync } from "../../../src/deno_ral/fs.ts";
13
import { testQuartoCmd } from "../../test.ts";
14
import { fileExists, noErrors, pathDoNotExists } from "../../verify.ts";
15
16
const renderDir = docs("project/ignore-dirs");
17
const outDir = join(Deno.cwd(), renderDir);
18
19
// Test that engine ignore directories are properly excluded
20
testQuartoCmd(
21
"render",
22
[renderDir],
23
[
24
noErrors,
25
fileExists(join(outDir, "index.html")), // Control: regular file should be rendered
26
pathDoNotExists(join(outDir, "venv", "test.html")), // venv (Jupyter) should be ignored
27
pathDoNotExists(join(outDir, "renv", "test.html")), // renv (Knitr) should be ignored
28
pathDoNotExists(join(outDir, "env", "test.html")), // env (Jupyter) should be ignored
29
],
30
{
31
teardown: async () => {
32
// Clean up rendered HTML files
33
const htmlFiles = [
34
join(outDir, "index.html"),
35
join(outDir, "venv", "test.html"),
36
join(outDir, "renv", "test.html"),
37
join(outDir, "env", "test.html"),
38
];
39
for (const file of htmlFiles) {
40
if (existsSync(file)) {
41
await Deno.remove(file);
42
}
43
}
44
},
45
},
46
);
47
48