Skip to content

Commit 811447f

Browse files
Always reset stored targets when running tests (#2109)
Stored targets were not updated if the fixture contained none. This means that stored targets from previous fixture was still active. In one case it made a instance tests incorrectly use the from target set by the previous recorded test and the instance test failed as a result. ## Checklist - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet
1 parent b25a14e commit 811447f

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,15 @@ async function runTest(file: string, spyIde: SpyIDE) {
8989

9090
editor.selections = fixture.initialState.selections.map(createSelection);
9191

92-
if (fixture.initialState.thatMark) {
93-
setStoredTarget(editor, "that", fixture.initialState.thatMark);
94-
}
92+
setStoredTarget(editor, "that", fixture.initialState.thatMark);
9593

96-
if (fixture.initialState.sourceMark) {
97-
setStoredTarget(editor, "source", fixture.initialState.sourceMark);
98-
}
94+
setStoredTarget(editor, "source", fixture.initialState.sourceMark);
9995

100-
if (fixture.initialState.instanceReferenceMark) {
101-
setStoredTarget(
102-
editor,
103-
"instanceReference",
104-
fixture.initialState.instanceReferenceMark,
105-
);
106-
}
96+
setStoredTarget(
97+
editor,
98+
"instanceReference",
99+
fixture.initialState.instanceReferenceMark,
100+
);
107101

108102
if (fixture.initialState.clipboard) {
109103
vscode.env.clipboard.writeText(fixture.initialState.clipboard);

0 commit comments

Comments
 (0)