Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompts can not be meaningfully rendered in non-TTY environments #78

Closed
brianjquinn opened this issue Mar 3, 2020 · 6 comments
Closed

Comments

@brianjquinn
Copy link

brianjquinn commented Mar 3, 2020

yeoman-test@2.2.0
yeoman-generator@4.6.0

Out of no where yesterday, my yeoman generator's unit tests using this yeoman-test run() function is suddenly failing with:

(node:6088) UnhandledPromiseRejectionWarning: Error: Prompts can not be meaningfully rendered in non-TTY environments
    at TestAdapter.promptModule (<redacted>/node_modules/inquirer/lib/inquirer.js:30:27)
    at TestAdapter.prompt (<redacted>/node_modules/yeoman-test/lib/adapter.js:78:22)
...

My test looks something like this:

const helpers = require('yeoman-test');
const generator = path.join(__dirname, '../generators/app');
const RunContext = helpers.run(generator).withPrompts({ ... }).withOptions({skipInstall: false}).inDir(path.join(__dirname, 'temp');

The above stack trace happens both in my build (Jenkins) and when run locally on the command line.

@mshima
Copy link
Member

mshima commented Mar 3, 2020

Inquirer.js has released version 7.0.5.
That seems to be the root cause.
You should consider a package lock file for now.

@mshima
Copy link
Member

mshima commented Mar 4, 2020

This problem was caused by SBoudrias/Inquirer.js#891
This PR should fix the problem SBoudrias/Inquirer.js#896

I analyzed the bug and it’s not fixable on yeoman-test.
It requires a new inquirer release.
Closing since we have to wait for an upstream fix.

@mshima mshima closed this as completed Mar 4, 2020
@SBoudrias
Copy link
Member

A new release has been pushed to npm. Let me know if that's still a problem!

ernscht added a commit to merkle-open/generator-nitro that referenced this issue Mar 6, 2020
to get working pipelines
reason: maybe this: yeoman/yeoman-test#78
@tuckbick
Copy link

tuckbick commented Mar 9, 2020

This doesn't seemed to have helped my case where I've provided prompt answers via withPrompts({...}). The isTTY check put into place in fetchAnswer() will run regardless of whether or not prompt answers have been provided.

@brianjquinn
Copy link
Author

@SBoudrias - My use case is identical to @tuckbick's and I also still experience the error quoted in this issue post updating to the latest npm release of inquirer (which I believe is 7.0.6)

@mshima
Copy link
Member

mshima commented Mar 10, 2020

There is a PR to fix this issue SBoudrias/Inquirer.js#903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants