Ensure existing context errors don't prevent parsing workflows
This commit is contained in:
@@ -5,6 +5,7 @@ import {ContextProviderConfig} from "./context-providers/config";
|
||||
import {registerLogger} from "./log";
|
||||
import {getPositionFromCursor} from "./test-utils/cursor-position";
|
||||
import {TestLogger} from "./test-utils/logger";
|
||||
import {testFileProvider} from "./test-utils/test-file-provider";
|
||||
|
||||
const contextProviderConfig: ContextProviderConfig = {
|
||||
getContext: async (context: string) => {
|
||||
@@ -1130,4 +1131,24 @@ jobs:
|
||||
|
||||
expect(result.find(x => x.label === "toJson")!.insertText).toBe("toJson");
|
||||
});
|
||||
|
||||
it("Parsing errors don't prevent reusable workflows from being loaded", async () => {
|
||||
const input = `
|
||||
on: push
|
||||
jobs:
|
||||
a:
|
||||
uses: ./reusable-workflow-with-outputs.yaml
|
||||
b:
|
||||
needs: [a]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "hello \${{ needs.a.outputs.| }}"
|
||||
`;
|
||||
const result = await complete(...getPositionFromCursor(input), {
|
||||
contextProviderConfig,
|
||||
fileProvider: testFileProvider
|
||||
});
|
||||
|
||||
expect(result.map(x => x.label)).toEqual(["build_id"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user