Path: blob/main/tests/smoke/engine/intermediate-output-markdown.test.ts
12921 views
import { dirname, join } from "path";1import { ensureSnapshotMatches, noErrors, printsMessage } from "../../verify.ts";2import { fileLoader } from "../../utils.ts";3import { safeRemoveIfExists } from "../../../src/core/path.ts";4import { testRender } from "../render/render.ts";56// Define engines to test7const engines = [8{ name: "knitr" },9{ name: "jupyter" },10{ name: "julia" }11];1213// Run tests for each engine14engines.forEach(engine => {15// Test for engine16const inputQmd = fileLoader(engine.name, "intermediate-markdown-output")("output-cell-div.qmd", "markdown");17const md = join(dirname(inputQmd.input), "output-cell-div.markdown.md");18testRender(inputQmd.input, "markdown", true, [19noErrors,20// Lua Warning are in INFO21printsMessage({ level: "INFO", regex: /WARNING \(.*\)\s+The following string was found in the document: :::/, negate: true}),22ensureSnapshotMatches(md)23], {24teardown: async () => {25safeRemoveIfExists(md);26} });27});28293031