Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/unit/guess-chunk-options-format.test.ts
6449 views
1
/*
2
* guess-chunk-option-format.test.ts
3
*
4
* Copyright (C) 2021-2022 Posit Software, PBC
5
*
6
*/
7
8
import { guessChunkOptionsFormat } from "../../src/core/lib/guess-chunk-options-format.ts";
9
10
import { unitTest } from "../test.ts";
11
import { assert } from "testing/asserts";
12
13
// deno-lint-ignore require-await
14
unitTest("guess-chunk-options-format-test", async () => {
15
const knitrOptionsChunk = `rmdworkflow,
16
echo = FALSE,
17
fig.cap = "A diagram illustrating how an R Markdown document
18
is converted to the final output document.",
19
out.width = "100%"`;
20
const yamlOptionsChunk = `foo: "echo = FALSE"`;
21
assert(guessChunkOptionsFormat(knitrOptionsChunk) === "knitr");
22
assert(guessChunkOptionsFormat(yamlOptionsChunk) === "yaml");
23
});
24
25