File tree Expand file tree Collapse file tree
packages/theme/src/cli/utilities/repl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import {DevServerSession} from '../theme-environment/types.js'
55import { describe , expect , test , vi } from 'vitest'
66import { outputInfo } from '@shopify/cli-kit/node/output'
77
8- import { createInterface } from 'readline'
8+ import { Interface } from 'readline'
99
1010vi . mock ( '@shopify/cli-kit/node/output' )
1111vi . mock ( './evaluator.js' )
@@ -21,10 +21,15 @@ describe('handleInput', () => {
2121 }
2222 const themeId = '123'
2323 const url = '/'
24- const rl = createInterface ( {
25- input : process . stdin ,
26- output : process . stdout ,
27- } )
24+ // Use a stub Interface instead of a real readline created from process.stdin.
25+ // In Node 26, readline.createInterface on a non-TTY stdin that is already
26+ // at EOF (as in Vitest workers) immediately closes the Interface, and
27+ // calling `prompt()` on a closed Interface throws `Error: readline was
28+ // closed` (it was a silent no-op in Node 22/24).
29+ const rl = {
30+ prompt : vi . fn ( ) ,
31+ close : vi . fn ( ) ,
32+ } as unknown as Interface
2833
2934 test ( 'should call outputInfo if input has {{ delimiter' , async ( ) => {
3035 // Given
You can’t perform that action at this time.
0 commit comments