11const path = require ( 'path' ) ;
22const fs = require ( 'fs' ) ;
33const mkdirp = require ( 'mkdirp' ) ;
4- const { createPrompt } = require ( '@inquirer/testing' ) ;
4+ const { PromptUI , inquirerPrompt } = require ( '@inquirer/testing' ) ; // Correct imports
55
66const runner = path . join ( __dirname , '../../bin/codecept.js' ) ;
77const codecept_dir = path . join ( __dirname , '/../data/sandbox/configs/init' ) ;
@@ -35,16 +35,16 @@ describe('Init Command', function () {
3535 } ) ;
3636
3737 it ( 'should init Codecept with TypeScript REST JSONResponse English' , async ( ) => {
38- const prompt = createPrompt ( ) ;
39-
40- prompt . inject ( [
41- 'Y ', // Confirm TypeScript usage
42- ' ', // Default for test location
43- 'DOWN' , 'DOWN' , 'DOWN ', 'ENTER' , // Select REST helper
44- 'y ', // Confirm JSONResponse usage
45- '' , // Default for logs/screenshots/reports
46- '' , // Default for localization
47- ] ) ;
38+ const promptUI = new PromptUI ( {
39+ input : inquirerPrompt ( [
40+ 'Y' , // Confirm TypeScript usage
41+ ' ', // Default for test location
42+ 'DOWN ', 'DOWN' , 'DOWN' , 'ENTER' , // Select REST helper
43+ 'y ', // Confirm JSONResponse usage
44+ ' ', // Default for logs/screenshots/reports
45+ '' , // Default for localization
46+ ] )
47+ } ) ;
4848
4949 await require ( runner ) . init ( codecept_dir ) ;
5050
@@ -56,16 +56,16 @@ describe('Init Command', function () {
5656 } ) ;
5757
5858 it . skip ( 'should init Codecept with JavaScript REST JSONResponse de-DE' , async ( ) => {
59- const prompt = createPrompt ( ) ;
60-
61- prompt . inject ( [
62- '' , // Default (No TypeScript)
63- ' ', // Default for test location
64- 'DOWN' , 'DOWN' , 'DOWN ', 'ENTER' , // Select REST helper
65- 'y ', // Confirm JSONResponse usage
66- ' ', // Default for logs/screenshots/reports
67- 'DOWN' , '' , // Select de-DE localization
68- ] ) ;
59+ const promptUI = new PromptUI ( {
60+ input : inquirerPrompt ( [
61+ '' , // Default (No TypeScript)
62+ '' , // Default for test location
63+ 'DOWN ', 'DOWN' , 'DOWN' , 'ENTER' , // Select REST helper
64+ 'y ', // Confirm JSONResponse usage
65+ ' ', // Default for logs/screenshots/reports
66+ 'DOWN ', '' , // Select de-DE localization
67+ ] )
68+ } ) ;
6969
7070 await require ( runner ) . init ( codecept_dir ) ;
7171
0 commit comments