Skip to content

Commit 6628b12

Browse files
committed
add @cderv's tests back
1 parent 83ea2a9 commit 6628b12

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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/core/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+
});

tests/smoke/render/render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from "../../verify.ts";
1717
import { safeRemoveSync } from "../../../src/core/path.ts";
1818
import { safeExistsSync } from "../../../src/core/path.ts";
19-
import { assert } from "../../../src/vendor/deno.land/[email protected]/assert/assert.ts";
19+
import { assert } from "testing/asserts";
2020

2121
export function testSimpleIsolatedRender(
2222
file: string,

0 commit comments

Comments
 (0)