MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / runTest

Function runTest

src/test/suite/crossCellsSetSelection.test.ts:20–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18});
19
20async function runTest() {
21 const graph = (await getCursorlessApi()).graph!;
22
23 await openNewNotebookEditor(['"hello"', '"world"']);
24
25 // FIXME: There seems to be some timing issue when you create a notebook
26 // editor
27 await sleep(1000);
28
29 await graph.hatTokenMap.addDecorations();
30
31 await vscode.commands.executeCommand(
32 "cursorless.command",
33 "take whale",
34 "setSelection",
35 [
36 {
37 type: "primitive",
38 mark: {
39 type: "decoratedSymbol",
40 symbolColor: "default",
41 character: "w",
42 },
43 },
44 ]
45 );
46
47 const editor = vscode.window.activeTextEditor;
48
49 if (editor == null) {
50 assert(false, "No editor was focused");
51 }
52
53 assert.deepStrictEqual(editor.document.getText(editor.selection), "world");
54}

Callers

nothing calls this directly

Calls 3

getCursorlessApiFunction · 0.90
openNewNotebookEditorFunction · 0.90
addDecorationsMethod · 0.45

Tested by

no test coverage detected