Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/unit/case-conversion/case-conversion.test.ts
6451 views
1
/*
2
* case-conversion.test.ts
3
*
4
* Copyright (C) 2020-2023 Posit Software, PBC
5
*
6
*/
7
8
import { unitTest } from "../../test.ts";
9
import { assert } from "testing/asserts";
10
import {
11
camelToKebab,
12
} from "../../../src/core/config.ts";
13
14
//https://github.com/quarto-dev/quarto-cli/issues/7358
15
// deno-lint-ignore require-await
16
unitTest("case convention - camelToKebab", async () => {
17
assert(camelToKebab("fooBar") === "foo-bar", "Invalid camelToKebab conversion");
18
assert(camelToKebab("fooBarBaz") === "foo-bar-baz", "Invalid camelToKebab conversion");
19
assert(camelToKebab("fragmentInURL") === "fragment-in-url", "Invalid camelToKebab conversion");
20
assert(camelToKebab("URLFragment") === "url-fragment", "Invalid camelToKebab conversion");
21
assert(camelToKebab("isURLHTMLString") === "is-urlhtml-string", "Invalid camelToKebab conversion");
22
assert(camelToKebab("isURLHTML") === "is-urlhtml", "Invalid camelToKebab conversion");
23
});
24
25