Skip to content

Commit

Permalink
added completion provider test
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmel committed Apr 28, 2024
1 parent ae4d06c commit 2f3ec29
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/suite/buildTools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ import mock from "mock-fs";
import { Range, Uri, workspace } from "vscode";
import * as tools from "../../src/commands/buildToolsCommand";
import { QuickFixProvider } from "../../src/services/quickFixProvider";
import { CompletionProvider } from "../../src/services/completionProvider";

describe("buildTools", () => {
const quickFix = new QuickFixProvider();

function setQHome(path: string) {
sinon
.stub(workspace, "getConfiguration")
Expand Down Expand Up @@ -77,6 +76,7 @@ describe("buildTools", () => {
await assert.rejects(() => tools.lintCommand(document));
});
it("should provide no QuickFix for empty diagnostics", async () => {
const quickFix = new QuickFixProvider();
const document = await openTextDocument("lint.q");
const result = await quickFix.provideCodeActions(
document,
Expand All @@ -85,4 +85,12 @@ describe("buildTools", () => {
assert.ok(!result);
});
});

describe("CompletionProvider", () => {
it("should provide global completions", async () => {
const comletion = new CompletionProvider();
const result = await comletion.provideCompletionItems();
assert.ok(Array.isArray(result));
});
});
});

0 comments on commit 2f3ec29

Please sign in to comment.