Open max-mapper opened 9 years ago
@sindresorhus how do you test CLI modules cleanly? know anything that fits our criteria above?
I don't [cleanly]. I've just been lazy using spawning and checking, but this sounds really good. I could definitely use something like this.
Regarding win-spawn
: https://github.com/IndigoUnited/node-cross-spawn#why
for testing cli modules more better we need a module that:
tape
e.g. you pass in a tape test instancetree-kill
to cleanup child processes after the test is donewin-spawn
to spawn processes correctly on windowsDEBUG=* npm test
it will stream the child process stdout/stderr to the parent stdout/stderrfor reference/inspiration: https://github.com/maxogden/dat/blob/master/test/tests/cli.js#L332