@@ -21,8 +21,8 @@ import type { InputMode } from '../utils/input-modes'
2121describe ( 'bash-mode' , ( ) => {
2222 describe ( 'entering bash mode' , ( ) => {
2323 test ( 'typing exactly "!" enters bash mode and clears input' , ( ) => {
24- const setInputMode = mock ( ( _mode : InputMode ) => { } )
25- const setInputValue = mock ( ( _value : any ) => { } )
24+ const setInputMode = mock ( ( ) => { } )
25+ const setInputValue = mock ( ( ) => { } )
2626
2727 // Simulate user typing '!'
2828 const inputValue = {
@@ -50,8 +50,8 @@ describe('bash-mode', () => {
5050 } )
5151
5252 test ( 'typing "!ls" does NOT enter bash mode (not exactly "!")' , ( ) => {
53- const setInputMode = mock ( ( _mode : InputMode ) => { } )
54- const setInputValue = mock ( ( _value : any ) => { } )
53+ const setInputMode = mock ( ( ) => { } )
54+ const setInputValue = mock ( ( ) => { } )
5555
5656 // Simulate user typing '!ls'
5757 const inputValue = {
@@ -78,15 +78,15 @@ describe('bash-mode', () => {
7878 } )
7979
8080 test ( 'typing "!" when already in bash mode does nothing special' , ( ) => {
81- const setInputMode = mock ( ( _mode : InputMode ) => { } )
82- const setInputValue = mock ( ( _value : any ) => { } )
81+ const setInputMode = mock ( ( ) => { } )
82+ const setInputValue = mock ( ( ) => { } )
8383
8484 const inputValue = {
8585 text : '!' ,
8686 cursorPosition : 1 ,
8787 lastEditDueToNav : false ,
8888 }
89- let inputMode = 'bash' as InputMode
89+ const inputMode = 'bash' as InputMode
9090
9191 const userTypedBang = inputMode === ( 'default' as InputMode ) && inputValue . text === '!'
9292
@@ -108,7 +108,7 @@ describe('bash-mode', () => {
108108
109109 describe ( 'exiting bash mode' , ( ) => {
110110 test ( 'backspace at cursor position 0 exits bash mode' , ( ) => {
111- const setInputMode = mock ( ( _mode : InputMode ) => { } )
111+ const setInputMode = mock ( ( ) => { } )
112112
113113 // Simulate backspace key press in bash mode at cursor position 0
114114 const inputMode : InputMode = 'bash'
@@ -128,7 +128,7 @@ describe('bash-mode', () => {
128128 } )
129129
130130 test ( 'backspace at cursor position 0 with non-empty input DOES exit bash mode' , ( ) => {
131- const setInputMode = mock ( ( _mode : InputMode ) => { } )
131+ const setInputMode = mock ( ( ) => { } )
132132
133133 const inputMode : InputMode = 'bash'
134134 const cursorPosition = 0
@@ -147,7 +147,7 @@ describe('bash-mode', () => {
147147 } )
148148
149149 test ( 'backspace at cursor position > 0 does NOT exit bash mode' , ( ) => {
150- const setInputMode = mock ( ( _mode : InputMode ) => { } )
150+ const setInputMode = mock ( ( ) => { } )
151151
152152 const inputMode : InputMode = 'bash'
153153 const cursorPosition : number = 2
@@ -166,7 +166,7 @@ describe('bash-mode', () => {
166166 } )
167167
168168 test ( 'other keys at cursor position 0 do NOT exit bash mode' , ( ) => {
169- const setInputMode = mock ( ( _mode : InputMode ) => { } )
169+ const setInputMode = mock ( ( ) => { } )
170170
171171 const inputMode : InputMode = 'bash'
172172 const cursorPosition = 0
@@ -185,9 +185,9 @@ describe('bash-mode', () => {
185185 } )
186186
187187 test ( 'backspace when NOT in bash mode does nothing to bash mode' , ( ) => {
188- const setInputMode = mock ( ( _mode : InputMode ) => { } )
188+ const setInputMode = mock ( ( ) => { } )
189189
190- let inputMode = 'default' as InputMode
190+ const inputMode = 'default' as InputMode
191191 const cursorPosition = 0
192192 const key = { name : 'backspace' }
193193
@@ -217,12 +217,10 @@ describe('bash-mode', () => {
217217 } )
218218
219219 test ( 'normal mode input can contain "!" anywhere' , ( ) => {
220- const inputMode : InputMode = 'default'
221220 const inputValue = 'fix this bug!'
222221
223222 // In normal mode, '!' is just a regular character
224223 expect ( inputValue ) . toContain ( '!' )
225- expect ( inputMode ) . toBe ( 'default' )
226224 } )
227225 } )
228226
@@ -249,8 +247,7 @@ describe('bash-mode', () => {
249247 } )
250248
251249 test ( 'submission saves command WITH "!" to history' , ( ) => {
252- const saveToHistory = mock ( ( _cmd : string ) => { } )
253- const inputMode : InputMode = 'bash'
250+ const saveToHistory = mock ( ( ) => { } )
254251 const trimmedInput = 'git status'
255252 const commandWithBang = '!' + trimmedInput
256253
@@ -261,7 +258,7 @@ describe('bash-mode', () => {
261258 } )
262259
263260 test ( 'submission exits bash mode after running command' , ( ) => {
264- const setInputMode = mock ( ( _mode : InputMode ) => { } )
261+ const setInputMode = mock ( ( ) => { } )
265262
266263 // After submission, bash mode should be exited
267264 setInputMode ( 'default' )
@@ -270,7 +267,7 @@ describe('bash-mode', () => {
270267 } )
271268
272269 test ( 'terminal command receives value WITHOUT "!" prefix' , ( ) => {
273- const runTerminalCommand = mock ( ( _params : any ) =>
270+ const runTerminalCommand = mock ( ( ) =>
274271 Promise . resolve ( [ { value : { stdout : 'output' } } ] ) ,
275272 )
276273 const trimmedInput = 'echo hello'
@@ -293,8 +290,8 @@ describe('bash-mode', () => {
293290 describe ( 'bash mode UI state' , ( ) => {
294291 test ( 'input mode is stored separately from input value' , ( ) => {
295292 // The inputMode is independent of the input text
296- const state1 = { inputMode : 'bash' as InputMode , inputValue : 'ls' }
297- const state2 = { inputMode : 'default' as InputMode , inputValue : 'hello' }
293+ const state1 : { inputMode : InputMode ; inputValue : string } = { inputMode : 'bash' , inputValue : 'ls' }
294+ const state2 : { inputMode : InputMode ; inputValue : string } = { inputMode : 'default' , inputValue : 'hello' }
298295
299296 expect ( state1 . inputMode ) . toBe ( 'bash' )
300297 expect ( state1 . inputValue ) . not . toContain ( '!' )
@@ -305,21 +302,21 @@ describe('bash-mode', () => {
305302
306303 test ( 'input width is adjusted in bash mode for "!" column' , ( ) => {
307304 const baseInputWidth = 100
308- const inputMode : InputMode = 'bash'
305+ const inputModeValue : InputMode = 'bash'
309306
310307 // Width should be reduced by 2 to account for '!' and spacing
311308 const adjustedInputWidth =
312- inputMode === 'bash' ? baseInputWidth - 2 : baseInputWidth
309+ inputModeValue === 'bash' ? baseInputWidth - 2 : baseInputWidth
313310
314311 expect ( adjustedInputWidth ) . toBe ( 98 )
315312 } )
316313
317314 test ( 'input width is NOT adjusted when not in bash mode' , ( ) => {
318315 const baseInputWidth = 100
319- let inputMode = 'default' as InputMode
316+ const inputModeValue = 'default' as InputMode
320317
321318 const adjustedInputWidth =
322- inputMode === ( 'bash' as InputMode ) ? baseInputWidth - 2 : baseInputWidth
319+ inputModeValue === ( 'bash' as InputMode ) ? baseInputWidth - 2 : baseInputWidth
323320
324321 expect ( adjustedInputWidth ) . toBe ( 100 )
325322 } )
@@ -338,7 +335,7 @@ describe('bash-mode', () => {
338335 test ( 'placeholder is normal when not in bash mode' , ( ) => {
339336 const normalPlaceholder = 'Ask Buffy anything...'
340337 const bashPlaceholder = 'enter bash command...'
341- let inputMode = 'default' as InputMode
338+ const inputMode = 'default' as InputMode
342339
343340 const effectivePlaceholder =
344341 inputMode === ( 'bash' as InputMode ) ? bashPlaceholder : normalPlaceholder
@@ -408,7 +405,7 @@ describe('bash-mode', () => {
408405 } )
409406
410407 test ( 'normal commands starting with "!" are NOT bash commands' , ( ) => {
411- let inputMode = 'default' as InputMode
408+ const inputMode = 'default' as InputMode
412409 const inputValue = '!ls' // User typed this in normal mode
413410
414411 // This should be treated as a normal prompt, not a bash command
@@ -418,7 +415,7 @@ describe('bash-mode', () => {
418415 } )
419416
420417 test ( 'bash mode takes precedence over slash commands' , ( ) => {
421- let inputMode = 'bash' as InputMode
418+ const inputMode = 'bash' as InputMode
422419 const trimmedInput = '/help' // Looks like a slash command
423420
424421 // But in bash mode, it's just a bash command
0 commit comments