-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move vscode-common's TestHelpers interface to its own file.
- Loading branch information
Barry Jaspan
committed
Nov 14, 2023
1 parent
a59841b
commit 51cc273
Showing
3 changed files
with
56 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import type { | ||
CommandServerApi, | ||
ExcludableSnapshotField, | ||
ExtraSnapshotField, | ||
HatTokenMap, | ||
IDE, | ||
NormalizedIDE, | ||
ScopeProvider, | ||
SerializedMarks, TargetPlainObject, | ||
TestCaseSnapshot, | ||
TextEditor | ||
} from "@cursorless/common"; | ||
import * as vscode from "vscode"; | ||
import {VscodeApi} from "./VscodeApi"; | ||
|
||
|
||
export interface TestHelpers { | ||
ide: NormalizedIDE; | ||
injectIde: (ide: IDE) => void; | ||
|
||
scopeProvider: ScopeProvider; | ||
|
||
hatTokenMap: HatTokenMap; | ||
|
||
commandServerApi: CommandServerApi; | ||
|
||
toVscodeEditor(editor: TextEditor): vscode.TextEditor; | ||
|
||
setStoredTarget( | ||
editor: vscode.TextEditor, | ||
key: string, | ||
targets: TargetPlainObject[] | undefined | ||
): void; | ||
|
||
// FIXME: Remove this once we have a better way to get this function | ||
// accessible from our tests | ||
takeSnapshot( | ||
excludeFields: ExcludableSnapshotField[], | ||
extraFields: ExtraSnapshotField[], | ||
editor: TextEditor, | ||
ide: IDE, | ||
marks: SerializedMarks | undefined, | ||
forceRealClipboard: boolean | ||
): Promise<TestCaseSnapshot>; | ||
|
||
runIntegrationTests(): Promise<void>; | ||
|
||
cursorlessTalonStateJsonPath: string; | ||
|
||
/** | ||
* A thin wrapper around the VSCode API that allows us to mock it for testing. | ||
*/ | ||
vscodeApi: VscodeApi; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters