Fix validation with moved definition

This commit is contained in:
Beth Brennan
2022-12-02 14:31:38 -05:00
parent 272e29a775
commit cd0c836769
3 changed files with 43 additions and 19 deletions
@@ -158,4 +158,33 @@ jobs:
}
} as Diagnostic);
});
it("unknown event type", async () => {
const result = await validate(
createDocument(
"wf.yaml",
`on: [push, check_run, pr]
jobs:
build:
runs-on:
- ubuntu-latest`
),
defaultValueProviders
);
expect(result.length).toBe(1);
expect(result[0]).toEqual({
message: "Unexpected value 'pr'",
range: {
end: {
character: 24,
line: 0
},
start: {
character: 22,
line: 0
}
}
} as Diagnostic);
});
});