-
-
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. (#2032)
This makes it easier to excise the related test-specific code from the repo. --------- Co-authored-by: Barry Jaspan <[email protected]> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
- Loading branch information
1 parent
024b5de
commit 620c538
Showing
3 changed files
with
57 additions
and
54 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