Commit 9e9db0a
committed
feat: add createIsolatedTerminal() test helper
Created a reusable test helper that ensures complete test isolation
by creating a fresh Ghostty WASM instance for each terminal.
Benefits:
- Single pattern for all tests: await createIsolatedTerminal()
- No manual Ghostty instance management in test files
- Clean slate guarantee - each test has isolated WASM memory
- Parallel-ready - no shared state between tests
- Simpler test code - just one function call
Updated all test files:
- lib/test-helpers.ts: New helper function
- lib/buffer.test.ts: Uses createIsolatedTerminal()
- lib/terminal.test.ts: Uses createIsolatedTerminal()
- lib/scrolling.test.ts: Uses createIsolatedTerminal()
- lib/selection-manager.test.ts: Uses createIsolatedTerminal()
- lib/input-handler.test.ts: Uses fresh Ghostty per test
All 283 tests pass with complete isolation.1 parent e30cce7 commit 9e9db0a
6 files changed
Lines changed: 280 additions & 255 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | | - | |
12 | | - | |
| 9 | + | |
| 10 | + | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
18 | 15 | | |
19 | 16 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 17 | | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
28 | | - | |
| 21 | + | |
29 | 22 | | |
30 | 23 | | |
31 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 130 | + | |
| 131 | + | |
133 | 132 | | |
134 | | - | |
135 | 133 | | |
136 | | - | |
137 | 134 | | |
138 | 135 | | |
139 | 136 | | |
| |||
0 commit comments