Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/smoke/render/render-date.test.ts
12925 views
1
/*
2
* render-date.test.ts
3
*
4
* Copyright (C) 2020-2022 Posit Software, PBC
5
*
6
*/
7
import { docs, outputForInput } from "../../utils.ts";
8
import { ensureFileRegexMatches } from "../../verify.ts";
9
import { testRender } from "./render.ts";
10
11
const tests = [
12
{ input: docs("date/today.qmd"), noMatch: />today</ },
13
{ input: docs("date/lastmodified.qmd"), noMatch: />last-modified</ },
14
{ input: docs("date/fr.qmd"), match: /octobre/, noMatch: /October/ },
15
{ input: docs("date/fr-FR.qmd"), match: /octobre/, noMatch: /October/ },
16
{ input: docs("date/fr-CA.qmd"), match: /octobre/, noMatch: /October/ },
17
];
18
19
tests.forEach((test) => {
20
const to = "html";
21
const output = outputForInput(test.input, "html");
22
23
const noMatch = test.noMatch ? [test.noMatch] : [];
24
const match = test.match ? [test.match] : [];
25
26
testRender(test.input, to, false, [
27
ensureFileRegexMatches(output.outputPath, match, noMatch),
28
]);
29
});
30
31