Elffuss BraidHub

kikocis/continue public

247f4e9d534b · 1.1 KiBRawPermalink
1import { expect } from "chai";
2import { EditorView, TextEditor } from "vscode-extension-tester";
3
4import { AutocompleteActions } from "../actions/Autocomplete.actions";
5import { GlobalActions } from "../actions/Global.actions";
6import { DEFAULT_TIMEOUT } from "../constants";
7
8describe("Autocomplete", () => {
9 let editor: TextEditor;
10
11 before(async function () {
12 process.env.NEXT_EDIT_TEST_ENABLED = "false";
13 });
14
15 beforeEach(async function () {
16 this.timeout(DEFAULT_TIMEOUT.XL);
17
18 await GlobalActions.openTestWorkspace();
19 ({ editor } = await GlobalActions.createAndOpenNewTextFile());
20 });
21
22 afterEach(async function () {
23 this.timeout(DEFAULT_TIMEOUT.XL);
24 await editor.clearText();
25 await new EditorView().closeAllEditors();
26 });
27
28 it("Should display completions", async () => {
29 await AutocompleteActions.testCompletions(editor);
30 }).timeout(DEFAULT_TIMEOUT.XL);
31 it("Should force a completion using the command", async () => {
32 const ghostText = await AutocompleteActions.forceCompletion(editor);
33 expect(ghostText).to.not.be.empty;
34 }).timeout(DEFAULT_TIMEOUT.XL);
35});