Open the-simian opened 9 years ago
I'm also experiencing this and it's preventing me from getting any tests whatsoever to work. I'll be fighting against this all day and might submit a PR if I'm able to figure out why it's doing this.
Update: Seems this line enables the prompt to be skipped if NODE_ENV is set to "test". However, this doesn't seem to have any effect at all; the prompt remains.
@aendrew I ended up mocking the prompt fully https://github.com/the-simian/slush-phaser-webpack/blob/master/test/state/task.js https://github.com/the-simian/slush-phaser-webpack/blob/master/test/inquirer-prompt-fixture.js
@the-simian My solution was to set the target directory to /tmp
:
const isTesting = process.env.NODE_ENV === 'test';
gulp.src(__dirname + '/templates/**')
.pipe(conflict(isTesting ? '/tmp' : './'))
.pipe(gulp.dest('./'));
I am also using the
mock-gulp-test module
. In situations when you are scaffolding files that are also the names of files in the scaffolding tool, like README.md and package.json, the confilct module prompts and interrupts the test, causing it to fail.with conflict in the pipeline
when I take it out everything is ok. This is only occuring on the unit tests, is there a way around this? I've tried doing something similar to what you are doing in this
but the prompts are still causing issues.
I would also add that the
.on('stop')
did not work in my tests, and I had to resort to usingon('task_stop')
. If this is the wrong module to be submitting this issue let me know.I haven't gone into exhaustive detail in case this is something you've encountered before. However, if you'd like more detail, let me know and I can flesh it out more throughout. Thank you very much for your hard work on this module and your time.