mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-27 14:31:17 -07:00
Chore(deps): Bump js-yaml from 4.3.1 to 5.3.0 (#7032)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
co-authored by
shamoon
parent
bdd77342d8
commit
a414f376b9
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { loadYaml } from "./yaml";
|
||||
|
||||
describe("utils/config/yaml", () => {
|
||||
it.each(["", " \n", "# comment only\n"])("loads an empty document from %j as undefined", (input) => {
|
||||
expect(loadYaml(input)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("loads a populated document", () => {
|
||||
expect(loadYaml("title: Homepage\n")).toEqual({ title: "Homepage" });
|
||||
});
|
||||
|
||||
it("preserves v4 merge key behavior", () => {
|
||||
expect(loadYaml("defaults: &defaults\n href: https://example.com\nservice:\n <<: *defaults\n")).toEqual({
|
||||
defaults: { href: "https://example.com" },
|
||||
service: { href: "https://example.com" },
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves v4 timestamp behavior without enabling YAML 1.1 booleans", () => {
|
||||
expect(loadYaml("date: 2026-08-21\nenabled: yes\n")).toEqual({
|
||||
date: new Date("2026-08-21T00:00:00.000Z"),
|
||||
enabled: "yes",
|
||||
});
|
||||
});
|
||||
|
||||
it("still rejects invalid YAML", () => {
|
||||
expect(() => loadYaml("value: [\n")).toThrow();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user