Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/smoke/render/render-html.test.ts
12925 views
1
/*
2
* render-html.test.ts
3
*
4
* Copyright (C) 2024 Posit Software, PBC
5
*
6
*/
7
8
import { existsSync } from "../../../src/deno_ral/fs.ts";
9
10
import { testRender } from "./render.ts";
11
import { fileLoader } from "../../utils.ts";
12
import { join } from "path";
13
import { assert } from "testing/asserts";
14
import { isWindows } from "../../../src/deno_ral/platform.ts";
15
16
const testFile = fileLoader()("test.qmd", "html");
17
18
// Simple rendering tests
19
testRender(testFile.input, "html", false, [], {
20
teardown: async () => {
21
// Bootstrap files should be in the libs folder
22
const bootstrapPath = join(testFile.output.supportPath, "libs", "bootstrap");
23
assert(existsSync(bootstrapPath), `Expected ${bootstrapPath} to exist`);
24
// Check that the bootstrap files have the correct mode
25
// Related to #660, and #11532
26
if (!isWindows) {
27
const files = Deno.readDirSync(bootstrapPath);
28
for (const file of files) {
29
if (file.name.match(/bootstrap-.*\.min\.css$/)) {
30
const fileInfo = Deno.statSync(join(bootstrapPath, file.name));
31
assert(
32
fileInfo.mode?.toString(8) === "100644",
33
`Expected file mode 100644, got ${fileInfo.mode?.toString(8)}`
34
);
35
}
36
}
37
}
38
},
39
});
40