Add more mapping key test cases

This commit is contained in:
Josh Gross
2022-11-23 15:23:17 -05:00
parent 109d9bc1be
commit 20e99a225c
@@ -197,6 +197,32 @@ jobs:
});
});
it("pos after mapping key", () => {
expect(
testFindToken(`on: push
jobs:
build:
continue-on-error:| foo`)
).toEqual({
parent: ["job-factory", TokenType.Mapping],
key: null,
token: null
});
});
it("pos at end of completed mapping key", () => {
expect(
testFindToken(`on: push
jobs:
build:
continue-on-error|: foo`)
).toEqual({
parent: ["job-factory", TokenType.Mapping],
key: null,
token: [null, TokenType.String, "continue-on-error"]
});
});
it("pos in mapping key without comment", () => {
expect(
testFindToken(`on: push