Commit 043a1dd
authored
Fix bug with injected ide in test case recorder (#1359)
This PR fixes a bug with our test case recorder. If an exception is
thrown during command processing before we inject a spy ide during
`TestCaseRecorder.preCommandHook`, we don't set the `originalIde` member
variable on `TestCaseRecorder`. During `TestCaseRecorder.finallyHook`,
we unconditionally call `injectIde(this.originalIde)` even in the case
of an error, which means that we will inject an `undefined` ide, so
Cursorless becomes completely broken, because `ide()` is now
`undefined`, so we get an error about not having injected ide for every
single subsequent command
This PR just checks that `this.originalIde != null` before trying to
inject it
## Checklist
- [x] 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 cheatsheet1 parent dde5802 commit 043a1dd
File tree
2 files changed
+61
-3
lines changed- packages
- cursorless-engine/src/testCaseRecorder
- cursorless-vscode-e2e/src/suite
2 files changed
+61
-3
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
436 | 438 | | |
437 | 439 | | |
438 | 440 | | |
| |||
Lines changed: 58 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
59 | 99 | | |
60 | 100 | | |
61 | 101 | | |
62 | 102 | | |
63 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
64 | 112 | | |
65 | 113 | | |
66 | 114 | | |
67 | 115 | | |
68 | 116 | | |
| 117 | + | |
69 | 118 | | |
| 119 | + | |
70 | 120 | | |
71 | 121 | | |
72 | 122 | | |
73 | 123 | | |
| 124 | + | |
74 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
75 | 131 | | |
76 | 132 | | |
77 | 133 | | |
| |||
88 | 144 | | |
89 | 145 | | |
90 | 146 | | |
| 147 | + | |
91 | 148 | | |
92 | | - | |
93 | | - | |
| 149 | + | |
94 | 150 | | |
95 | 151 | | |
96 | 152 | | |
| |||
0 commit comments