hypertune
Version:
[Hypertune](https://www.hypertune.com/) is the most flexible platform for feature flags, A/B testing, analytics and app configuration. Built with full end-to-end type-safety, Git-style version control and local, synchronous, in-memory flag evaluation. Opt
37 lines (35 loc) • 1.23 kB
text/typescript
import { expect, test } from "vitest";
import toStartCase from "./toStartCase";
test.each([
["", ""],
["a", "A"],
["thing", "Thing"],
["some_snake_case_thing", "Some Snake Case Thing"],
["Some_Caps_Snake_Case_Thing", "Some Caps Snake Case Thing"],
["someCamelCaseThing", "Some Camel Case Thing"],
["SomePascalCaseThing", "Some Pascal Case Thing"],
["some-kebab-case-thing", "Some Kebab Case Thing"],
["some spaced thing", "Some Spaced Thing"],
["some-cursed mixOfThings_going_on", "Some Cursed Mix Of Things Going On"],
["downloadUrl", "Download Url"],
["download_url", "Download Url"],
["download_Url", "Download Url"],
["Download_Url", "Download Url"],
["downloadURL", "Download URL"],
["DownloadURL", "Download URL"],
["XMLHttpRequest", "XML HTTP Request"],
["XmlHTTPRequest", "XML HTTP Request"],
["someAI", "Some AI"],
["SomeAI", "Some AI"],
["v2", "V2"],
["V2", "V2"],
["flagV2", "Flag V2"],
["flag_V2", "Flag V2"],
["flag_v2", "Flag V2"],
["upgradeOn20230428", "Upgrade On 20230428"],
[" spaced -_out -", "Spaced Out"],
["enableCrm", "Enable CRM"],
["showUiV2", "Show UI V2"],
])("%s -> %s", (input, expected) => {
expect(toStartCase(input)).toBe(expected);
});