ember-cli-addon-tests icon indicating copy to clipboard operation
ember-cli-addon-tests copied to clipboard

Fails when addon blueprint causes an interactive prompt

Open simonihmig opened this issue 8 years ago • 3 comments

When the addon under test has a default blueprint that causes an interactive prompt to appear (either by programmatically calling that or because ember-cli asks whether to overwrite files), the ember generate my-addon call will never terminate, causing a timeout in tests. Probably the same happens when app.runEmberCommand is called that causes a prompt.

Related: https://github.com/kaliber5/ember-fastboot-addon-tests/issues/15

simonihmig avatar Sep 18 '17 12:09 simonihmig

Tbh, I don't see an easy solution, @kellyselden do you?

simonihmig avatar Sep 18 '17 12:09 simonihmig

Not an easy solution, but it can be done. See here https://github.com/kellyselden/ember-cli-update/blob/v0.6.1/test/acceptance/ember-addon-test.js#L71-L79

kellyselden avatar Sep 18 '17 15:09 kellyselden

Yeah, it looks like it can be handled. I guess the question would be - what kind of control would we want to add for the user? Go with the default for all the prompts, allow a hash with question and answer, regex match for questions mapped to answers? Something easier?

In my particular case described in the linked issue, ember cli is asking if I'd like to overwrite a file, and I'd like to answer "no". The default is "yes".

kimroen avatar Sep 18 '17 19:09 kimroen