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

Function runTest

src/test/suite/toggleDecorations.test.ts:18–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16});
17
18async function runTest() {
19 const { hatTokenMap } = (await getCursorlessApi()).graph!;
20
21 await openNewEditor("Hello world testing whatever");
22
23 // Check that hats appear by default
24 await hatTokenMap.addDecorations();
25 assert((await hatTokenMap.getReadableMap(false)).getEntries().length !== 0);
26
27 // Check that hats disappear when turned off
28 await vscode.commands.executeCommand("cursorless.toggleDecorations");
29 await hatTokenMap.addDecorations();
30 assert((await hatTokenMap.getReadableMap(false)).getEntries().length === 0);
31
32 // Check that hats reappear when turned back on
33 await vscode.commands.executeCommand("cursorless.toggleDecorations");
34 await hatTokenMap.addDecorations();
35 assert((await hatTokenMap.getReadableMap(false)).getEntries().length !== 0);
36}

Callers 1

Calls 5

getCursorlessApiFunction · 0.90
openNewEditorFunction · 0.90
getReadableMapMethod · 0.80
getEntriesMethod · 0.65
addDecorationsMethod · 0.45

Tested by

no test coverage detected