()
| 202 | } |
| 203 | |
| 204 | export function getCurrentInput(): string { |
| 205 | const last = inputEvents[inputEvents.length - 1]; |
| 206 | |
| 207 | if (last !== undefined) { |
| 208 | const lastWordIndex = last.data.wordIndex; |
| 209 | //just advanced to a new word - no input event for it yet |
| 210 | if (lastWordIndex + 1 === activeWordIndex) return ""; |
| 211 | //last event is for the active word - return its snapshot |
| 212 | if ( |
| 213 | lastWordIndex === activeWordIndex && |
| 214 | last.data.inputValue !== undefined |
| 215 | ) { |
| 216 | return last.data.inputValue; |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | return getInputFromDom(getEventsForWord(getAllTestEvents(), activeWordIndex)); |
| 221 | } |
| 222 | |
| 223 | export function getInputForWord(wordIndex: number): string { |
| 224 | return getInputFromDom( |
no test coverage detected