Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/smoke/engine/intermediate-output-markdown.test.ts
12925 views
1
import { dirname, join } from "path";
2
import { ensureSnapshotMatches, noErrors, printsMessage } from "../../verify.ts";
3
import { fileLoader } from "../../utils.ts";
4
import { safeRemoveIfExists } from "../../../src/core/path.ts";
5
import { testRender } from "../render/render.ts";
6
7
// Define engines to test
8
const engines = [
9
{ name: "knitr" },
10
{ name: "jupyter" },
11
{ name: "julia" }
12
];
13
14
// Run tests for each engine
15
engines.forEach(engine => {
16
// Test for engine
17
const inputQmd = fileLoader(engine.name, "intermediate-markdown-output")("output-cell-div.qmd", "markdown");
18
const md = join(dirname(inputQmd.input), "output-cell-div.markdown.md");
19
testRender(inputQmd.input, "markdown", true, [
20
noErrors,
21
// Lua Warning are in INFO
22
printsMessage({ level: "INFO", regex: /WARNING \(.*\)\s+The following string was found in the document: :::/, negate: true}),
23
ensureSnapshotMatches(md)
24
], {
25
teardown: async () => {
26
safeRemoveIfExists(md);
27
} });
28
});
29
30
31