Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/unit/yaml-intelligence/annotated-yaml.test.ts
6456 views
1
/*
2
* annotated-yaml.test.ts
3
*
4
* Copyright (C) 2020-2022 Posit Software, PBC
5
*/
6
import { assert } from "testing/asserts";
7
8
import { readAnnotatedYamlFromString } from "../../../src/core/lib/yaml-intelligence/annotated-yaml.ts";
9
import { yamlValidationUnitTest } from "../schema-validation/utils.ts";
10
11
yamlValidationUnitTest(
12
"annotated-yaml-should-respect-json-schema",
13
// deno-lint-ignore require-await
14
async () => {
15
const annotation = readAnnotatedYamlFromString("2020-01-01");
16
assert(typeof annotation.result === "string");
17
},
18
);
19
20
yamlValidationUnitTest(
21
"https://github.com/quarto-dev/quarto-cli/issues/6269",
22
// deno-lint-ignore require-await
23
async () => {
24
// ensure this doesn't crash
25
const annotation = readAnnotatedYamlFromString("|\n Line 1\n Line 2\n");
26
assert(typeof annotation.result === "string");
27
},
28
);
29
30