(key: Partial<Key>)
| 91 | |
| 92 | // Helper to simulate a single keypress event. |
| 93 | pressKey(key: Partial<Key>) { |
| 94 | if (this.isLegacy) { |
| 95 | this.emit('data', Buffer.from(key.sequence ?? '')); |
| 96 | } else { |
| 97 | this.emit('keypress', null, key); |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | describe('useKeypress', () => { |