Merge pull request #72 from github/thyeggman/hover-property-tests

Add hover property tests
This commit is contained in:
Jacob Wallraff
2023-01-06 14:30:52 -08:00
committed by GitHub
2 changed files with 32 additions and 6 deletions
+26
View File
@@ -25,6 +25,32 @@ jobs:
expect(result?.contents).toEqual("Runs your workflow when you push a commit or tag.");
});
it("on a parameter with a description", async () => {
const input = `on: push
jobs:
build:
co|ntinue-on-error: false`;
const result = await hover(...getPositionFromCursor(input));
expect(result).not.toBeUndefined();
expect(result?.contents).toEqual(
"Prevents a workflow run from failing when a job fails. Set to true to allow a workflow run to pass when this job fails.\n\n" +
"**Context:** github, inputs, vars, needs, strategy, matrix"
);
});
it("on a parameter with its own type", async () => {
const input = `on: push
jobs:
build:
pe|rmissions: read-all`;
const result = await hover(...getPositionFromCursor(input));
expect(result).not.toBeUndefined();
expect(result?.contents).toEqual(
"You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access."
);
});
it("on a value in a sequence", async () => {
const input = `on: [pull_request,
pu|sh]
+6 -6
View File
@@ -702,9 +702,9 @@
"link": true
},
"node_modules/@github/actions-workflow-parser": {
"version": "0.0.39",
"resolved": "https://npm.pkg.github.com/download/@github/actions-workflow-parser/0.0.39/ba3e9e02e489175e0f284f0aebd9bde92ad4e935",
"integrity": "sha512-Iw8OkCUxdgFvXpJkg6dAIEpGQrS09o3TC1I0looCJ1lHMBDBD7aVXasE8zJzlQUTdgRTGMiptNMgZS2MnGC76Q==",
"version": "0.0.41",
"resolved": "https://npm.pkg.github.com/download/@github/actions-workflow-parser/0.0.41/234e6042ee06199b4314589ad77dfd7fe0debe6d",
"integrity": "sha512-s27gUhNH80YhFmkcQ5GE5BA5D15xbQ48YjwKCwYKN+ndldaOhpqa+v5Q+NfZlNwBmJ/8lJZob09/IiGRgFq7ag==",
"license": "MIT",
"dependencies": {
"@github/actions-expressions": "*",
@@ -13565,9 +13565,9 @@
}
},
"@github/actions-workflow-parser": {
"version": "0.0.39",
"resolved": "https://npm.pkg.github.com/download/@github/actions-workflow-parser/0.0.39/ba3e9e02e489175e0f284f0aebd9bde92ad4e935",
"integrity": "sha512-Iw8OkCUxdgFvXpJkg6dAIEpGQrS09o3TC1I0looCJ1lHMBDBD7aVXasE8zJzlQUTdgRTGMiptNMgZS2MnGC76Q==",
"version": "0.0.41",
"resolved": "https://npm.pkg.github.com/download/@github/actions-workflow-parser/0.0.41/234e6042ee06199b4314589ad77dfd7fe0debe6d",
"integrity": "sha512-s27gUhNH80YhFmkcQ5GE5BA5D15xbQ48YjwKCwYKN+ndldaOhpqa+v5Q+NfZlNwBmJ/8lJZob09/IiGRgFq7ag==",
"requires": {
"@github/actions-expressions": "*",
"yaml": "^2.0.0-8"