…ll' as the stream type
`spawn.sendEof` allows users to close child's process stdin stream and let it know there are no more data coming. This change enables testing of apps that are using inquirer, as `inquirer.prompt()` calls `stdin.resume()` at some point, which causes the app to block on input when the input stream is a pipe.
Improve the error reported when the child process exits before the whole queue is processed: - use assert.AssertionError instead of plain Error - fill actual and expected properties - include the description of items remaining in the queue
Modify the error reported when a line does not match the expectation provided by `expect` or `wait`: - use assert.AssertionError instead of plain Error - fill actual and expected properties - include the expectation in the error message
- Wait for 'close' event, not 'exit' exit occurs when child has exited, but that can be before the parent process has consumed stdout, as happens when testing `echo hello`, which exits before the parent has process the queue of expectations - Listen for 'error' event Code seems to expect to get notified of command not found through the shell convention of exiting with 127 when it can't find the command to exit. This isn't how node works anymore, it uses an error event. - Tests assumed the err object was second argument to run callback, but it is first. - Tests involving sendfile never complete, vows just hangs, waiting. Have not tracked down, but I commented the tests out for the short term.
Callback parameters should be `(err, stdout, exitcode)`. The change introduced by commit 587f600 was breaking API and also all unit-tests. Updated README.md to show the callback parameters.