Add more tests

This commit is contained in:
Christopher Schleiden
2022-11-23 06:26:44 -08:00
parent 9f5ced7bd3
commit 1962968440
5 changed files with 138 additions and 14 deletions
+22 -1
View File
@@ -157,7 +157,7 @@ jobs:
const result = await complete(...getPositionFromCursor(input));
expect(result).not.toBeUndefined();
expect(result.length).toEqual(0);
expect(result.length).toEqual(17);
});
it("custom value providers override defaults", async () => {
@@ -202,4 +202,25 @@ jobs:
expect(result).not.toBeUndefined();
expect(result.map(x => x.label).sort()).toEqual(["cancel-in-progress", "group"]);
});
it("job key", async () => {
const input = `on: push
jobs:
build:
runs-|`;
const result = await complete(...getPositionFromCursor(input));
expect(result).not.toBeUndefined();
expect(result).toHaveLength(20);
});
it("job key with comment afterwards", async () => {
const input = `on: push
jobs:
build:
runs-|
#`;
const result = await complete(...getPositionFromCursor(input));
expect(result).not.toBeUndefined();
expect(result).toHaveLength(20);
});
});