Questions tagged [inquirer]

77 questions
2
votes
0 answers

@oclif/test with `inquirer.prompt`

I am trying to test my entire cli dialogs using oclif and @oclif/test. Prompts are made with inquirer. Everything work fine, except the use of the .stdin( mock. Feature extract looks like this: ... const { sessionToken } = await inquirer.prompt([{ …
Slim
  • 1,256
  • 1
  • 13
  • 25
2
votes
1 answer

How to test async code with Jest without passing it as a callback?

Will be grateful if someone could clarify to me how test the async code from inquirer plugin for CLI app. The module exports updateView function, which calls async inquirer.prompt inside. const inquirer = require("inquirer"); const getAnswer =…
2
votes
1 answer

Unit testing Inquirer with Jest

I've been trying to understand searching various forums, but could not get to what I'm looking for. Partly because of my NodeJS ignorance. I'm just starting up. My task is to unit test inquirer based CLI via Jest/Mocha. How do I mock and test…
Aravind
  • 515
  • 1
  • 5
  • 9
2
votes
1 answer

Trigger input on Gitlab Ci

I'm so curious about trigger input on gitlab CI pipeline *cmiiw. So, the main problem when there's any prompt on Node.js like this, Ubuntu But when i'm trying to implementation into Gitlab CI, there's any error something like this Gitlab.CI This…
1
vote
1 answer

error: (25, 'Inappropriate ioctl for device')

So I've been trying to code a multiple choice question with the 'inquirer' function. The problem is that when I run it this appears with dozens of lines I don't understand: error: (25, 'Inappropriate ioctl for device') There should normally be…
David
  • 11
  • 2
1
vote
0 answers

Is it possible to validade oclif flags values

I want to know if it's possible to validate the flag value before the command is executed. healthCheckPort: Flags.integer({ description: 'This flag allows you to choose what port the health check sever is running on.', default: 6000, …
n3n3
  • 288
  • 1
  • 7
1
vote
2 answers

Inquirer on node.js

PS D:\Cursos\nodeudemy\aulas\2_FUNDAMENTOS\10_abstracao_input> node index.js D:\Cursos\nodeudemy\aulas\2_FUNDAMENTOS\10_abstracao_input\index.js:1 const inquirer = require('inquirer') ^ Error [ERR_REQUIRE_ESM]: require() of ES…
Julia
  • 13
  • 1
  • 1
  • 3
1
vote
1 answer

Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`,

I don't know why am I getting the following error which say: Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated…
crispengari
  • 7,901
  • 7
  • 45
  • 53
1
vote
1 answer

Can't get data to generator page in node.js

I'm building a team profile generator using node.js. I am using the inquirer package and I'm able to get the answers and build the teamArray but I cannot seem to pass the data to the generator page. When the generate writes the file it just puts…
1
vote
1 answer

How to create a multiple choice inquirer?

I am creating a program (using Python) that allows users to automatically generate a TXT file with sentences randomly selected from three files (one for each level: A, B, C). The user can select one or more of these three files and the total number…
Andrea
  • 47
  • 5
1
vote
2 answers

How to get index value of choice made with Inquirer?

I'm trying to get an integer value from the user when this questions is asked: let q4 = { type: 'list', name: 'manager', message: 'Who do they report to?', choices: ['Jen','Rachel','Tania'] }; let…
mcilhaggis
  • 55
  • 1
  • 10
1
vote
2 answers

Using previous answer for the next question in inquirer

I want to use the previous answer for the next question in inquirer, and this is my code: const promptForMissingOptions = async (options) => { const questions = []; if (!options.name) { questions.push({ type: "input", name:…
Renaud is Not Bill Gates
  • 1,684
  • 34
  • 105
  • 191
1
vote
1 answer

Parametizing table name Node.js/mySQL?

So I have three mySQL database tables that I need to be able to add records to from inquirer. Rather than write three separate functions, I'd like to just have one efficient function that can do all three depending on the input. The user is asked…
1
vote
1 answer

How do you test inquirer CLIS?

I would like to write units tests for a CLI I made in inquirer. I want to verify that the prompts are displayed correctly, simulate choices in the command line, and verify that the resonses are correct.
Toli
  • 5,547
  • 8
  • 36
  • 56
1
vote
1 answer

Python: inquirer validate function

Can I use a separate function for inquirer validate function or it has to be lambda function? I'm trying to ask a question about shift count. So I have to check it's number or not. I wrote a function that checks its argument number or not and…