test(yaml): add condenseFlow() test (#5780)

initial commit
This commit is contained in:
Tim Reichen 2024-08-22 23:09:16 +02:00 committed by GitHub
parent bb0db58caa
commit 60402c697f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -678,3 +678,16 @@ Deno.test("stringify() uses quotes around deprecated boolean notations when `com
Deno.test("stringify() handles undefined with skipInvalid option", () => {
assertEquals(stringify(undefined, { skipInvalid: true }), "");
});
Deno.test({
name: "stringify() handles object with condenseFlow option",
fn() {
assertEquals(
stringify({ foo: ["bar", "baz"], bar: { hello: "world" } }, {
flowLevel: 1,
condenseFlow: true,
}),
`foo: [bar,baz]\nbar: {"hello":world}\n`,
);
},
});