Skip to content

Commit 085a0b8

Browse files
committed
Improve assertion
1 parent 8d005f9 commit 085a0b8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/options.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import { parse } from "./parse.ts";
44
// https://github.com/eemeli/yaml/blob/main/src/schema/yaml-1.1/merge.ts
55
test(`duplicate '<<' keys should always be allowed`, () => {
66
const text = "<<: 1\n<<: 2";
7-
expect(parse(text)).toBeDefined();
8-
expect(parse(text, { uniqueKeys: false })).toBeDefined();
9-
const ast = parse(text, { uniqueKeys: true });
7+
const ast = parse(text);
108
expect(ast).toBeDefined();
119
const node = ast.children[0].children[1].children[0];
1210
expect(node?.type).toBe("mapping");
11+
12+
expect(parse(text, { uniqueKeys: true })).toStrictEqual(ast);
13+
expect(parse(text, { uniqueKeys: false })).toStrictEqual(ast);
1314
});
1415

1516
for (const { type, text } of [

0 commit comments

Comments
 (0)