Fix a couple more tests

This commit is contained in:
Jacob Wallraff
2023-03-06 12:44:54 -08:00
parent b3f22cb702
commit 9c3977d510
2 changed files with 12 additions and 0 deletions
@@ -2,6 +2,7 @@ import {CompletionItem, MarkupContent} from "vscode-languageserver-types";
import {complete} from "./complete";
import {getPositionFromCursor} from "./test-utils/cursor-position";
import {testFileProvider} from "./test-utils/test-file-provider";
import { clearParsedCache, clearWorkflowTemplateCache } from "./utils/workflow-cache";
function mapResult(result: CompletionItem[]) {
return result.map(x => {
@@ -9,6 +10,11 @@ function mapResult(result: CompletionItem[]) {
});
}
beforeEach(() => {
clearWorkflowTemplateCache();
clearParsedCache();
});
describe("completion with reusable workflows", () => {
it("completes job inputs", async () => {
const input = `
@@ -1,5 +1,11 @@
import { clearParsedCache, clearWorkflowTemplateCache } from "../utils/workflow-cache";
import {getPositionFromCursor} from "./cursor-position";
beforeEach(() => {
clearWorkflowTemplateCache();
clearParsedCache();
});
describe("getPositionFromCursor", () => {
it("returns the position of the cursor and the document without that cursor", () => {
const input = "on: push\njobs:|";