diff --git a/actions-languageservice/src/complete.test.ts b/actions-languageservice/src/complete.test.ts index 2ba5a6f..20c9dd1 100644 --- a/actions-languageservice/src/complete.test.ts +++ b/actions-languageservice/src/complete.test.ts @@ -312,7 +312,7 @@ jobs: // Includes detail when available. Using continue-on-error as a sample here. expect(result.map(x => (x.documentation as MarkupContent)?.value)).toContain( - "Prevents a job from failing when a step fails. Set to true to allow a job to pass when this step fails." + "Prevents a job from failing when a step fails. Set to `true` to allow a job to pass when this step fails." ); }); @@ -337,9 +337,7 @@ o| const result = await complete(...getPositionFromCursor(input)); const onResult = result.find(x => x.label === "on"); expect(onResult).not.toBeUndefined(); - expect((onResult!.documentation as MarkupContent).value).toEqual( - "The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows." - ); + expect((onResult!.documentation as MarkupContent).value).toContain("The GitHub event that triggers the workflow."); }); it("event list includes descriptions when available ", async () => { @@ -348,8 +346,8 @@ o| const result = await complete(...getPositionFromCursor(input)); const dispatchResult = result.find(x => x.label === "workflow_dispatch"); expect(dispatchResult).not.toBeUndefined(); - expect((dispatchResult!.documentation as MarkupContent).value).toEqual( - "You can now create workflows that are manually triggered with the new workflow_dispatch event. You will then see a 'Run workflow' button on the Actions tab, enabling you to easily trigger a run." + expect((dispatchResult!.documentation as MarkupContent).value).toContain( + "The `workflow_dispatch` event allows you to manually trigger a workflow run." ); }); diff --git a/actions-languageservice/src/hover.test.ts b/actions-languageservice/src/hover.test.ts index c1a0dc3..1fce7e9 100644 --- a/actions-languageservice/src/hover.test.ts +++ b/actions-languageservice/src/hover.test.ts @@ -9,9 +9,7 @@ jobs: runs-on: [self-hosted]`; const result = await hover(...getPositionFromCursor(input)); expect(result).not.toBeUndefined(); - expect(result?.contents).toEqual( - "The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows." - ); + expect(result?.contents).toContain("The GitHub event that triggers the workflow."); }); it("on a value", async () => { @@ -44,8 +42,8 @@ jobs: 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." + expect(result?.contents).toContain( + "You can use `permissions` to modify the default permissions granted to the `GITHUB_TOKEN`" ); }); diff --git a/actions-workflow-parser/src/index.test.ts b/actions-workflow-parser/src/index.test.ts index d94034c..de071cb 100644 --- a/actions-workflow-parser/src/index.test.ts +++ b/actions-workflow-parser/src/index.test.ts @@ -92,16 +92,14 @@ jobs: case "name": { const nameKey = pair.key.assertString("name"); expect(nameKey.definition).not.toBeUndefined(); - expect(nameKey.description).toBe("The name of the workflow."); + expect(nameKey.description).toContain("The name of the workflow"); break; } case "on": { const onKey = pair.key.assertString("on"); const onValue = pair.value.assertString("push"); expect(onKey.definition).not.toBeUndefined(); - expect(onKey.description).toBe( - "The name of the GitHub event that triggers the workflow. You can provide a single event string, array of events, array of event types, or an event configuration map that schedules a workflow or restricts the execution of a workflow to specific files, tags, or branch changes. For a list of available events, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows." - ); + expect(onKey.description).toContain("The GitHub event that triggers the workflow."); expect(onValue.definition).not.toBeUndefined(); expect(onValue.description).toBe("Runs your workflow when you push a commit or tag."); break; diff --git a/actions-workflow-parser/testdata/reader/events-mapping-all.yml b/actions-workflow-parser/testdata/reader/events-mapping-all.yml index 70560a1..264c751 100644 --- a/actions-workflow-parser/testdata/reader/events-mapping-all.yml +++ b/actions-workflow-parser/testdata/reader/events-mapping-all.yml @@ -85,7 +85,7 @@ on: types: - created - closed - - opened + - reopened - edited - deleted project_card: @@ -327,7 +327,7 @@ jobs: "types": [ "created", "closed", - "opened", + "reopened", "edited", "deleted" ]