Update tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {TextEdit} from "vscode-languageserver-types";
|
||||
import {MarkupContent, TextEdit} from "vscode-languageserver-types";
|
||||
import {complete} from "./complete";
|
||||
import {WorkflowContext} from "./context/workflow-context";
|
||||
import {registerLogger} from "./log";
|
||||
@@ -311,7 +311,7 @@ jobs:
|
||||
]);
|
||||
|
||||
// Includes detail when available. Using continue-on-error as a sample here.
|
||||
expect(result.map(x => x.detail)).toContain(
|
||||
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."
|
||||
);
|
||||
});
|
||||
@@ -337,7 +337,7 @@ o|
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
const onResult = result.find(x => x.label === "on");
|
||||
expect(onResult).not.toBeUndefined();
|
||||
expect(onResult?.detail).toEqual(
|
||||
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."
|
||||
);
|
||||
});
|
||||
@@ -348,7 +348,7 @@ o|
|
||||
const result = await complete(...getPositionFromCursor(input));
|
||||
const dispatchResult = result.find(x => x.label === "workflow_dispatch");
|
||||
expect(dispatchResult).not.toBeUndefined();
|
||||
expect(dispatchResult?.detail).toEqual(
|
||||
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."
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {TextDocument} from "vscode-languageserver-textdocument";
|
||||
import {hover} from "./hover";
|
||||
import {getPositionFromCursor} from "./test-utils/cursor-position";
|
||||
|
||||
@@ -25,7 +24,6 @@ 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:
|
||||
@@ -35,7 +33,7 @@ jobs:
|
||||
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"
|
||||
"**Context:** github, inputs, vars, needs, strategy, matrix"
|
||||
);
|
||||
});
|
||||
|
||||
@@ -52,7 +50,7 @@ jobs:
|
||||
});
|
||||
|
||||
it("on a value in a sequence", async () => {
|
||||
const input = `on: [pull_request,
|
||||
const input = `on: [pull_request,
|
||||
pu|sh]
|
||||
jobs:
|
||||
build:
|
||||
|
||||
Reference in New Issue
Block a user