Add basic github context provider

This commit is contained in:
Beth Brennan
2022-12-12 19:06:08 -05:00
parent 78589ec327
commit db22088ab2
3 changed files with 78 additions and 10 deletions
@@ -36,7 +36,7 @@ describe("expressions", () => {
describe("top-level auto-complete", () => {
it("single region", async () => {
const input = "run-name: ${{ | }}";
const result = await complete(...getPositionFromCursor(input), undefined, contextProviderConfig);
const result = await complete(...getPositionFromCursor(input), undefined, undefined);
expect(result.map(x => x.label)).toEqual([
"github",
@@ -320,6 +320,23 @@ jobs:
expect(result).toEqual([]);
});
it("github context includes expected keys", async () => {
const input = `
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo \${{ github.| }}
`;
const result = await complete(...getPositionFromCursor(input), undefined, undefined);
expect(result.map(x => x.label)).toContain("actor");
});
describe("steps context", () => {
it("includes defined step IDs", async () => {
const input = `