Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/smoke/website/website-ignore-dirs.test.ts
12921 views
1
/*
2
* website-ignore-dirs.test.ts
3
*
4
* Verifies that engine-specific ignore directories (venv, renv, env, packrat, etc.)
5
* are properly excluded from website 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("websites/website-ignore-dirs");
17
const outDir = join(Deno.cwd(), renderDir, "_site");
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
if (existsSync(outDir)) {
33
await Deno.remove(outDir, { recursive: true });
34
}
35
},
36
},
37
);
38
39