* Remove timestamp from non-watch test runs
* Fix mini reporter tests
* Pass options object to reporter constructor with watching boolean
* Refactor reporter options
* Move timestamp lines to watcher test
Fixes#699. The watcher tracks how many failures (actual failures, but also
rejections and uncaught exceptions) occurred for each test file. After each run,
if there are failures from files that were not rerun, the count is added to the
logger output.
* display current time when mini & verbose reporters finish
I'm using toLocaleTimeString() which works even back to Node.js 0.10. Forcing a
24-hour clock because we're geeks.
* watcher: restart logger on subsequent runs
The CLI starts the logger so the watcher shouldn't reset it on its first run.
Restart the logger after resetting, this allows the mini reporter to render its
spinner.
* better api.run stub in watcher test
Return an object for the runStatus, add assertions to verify this object is
passed to logger.finish()
* assert that r/rs reruns all tests
* clear mini reporter in watch mode
Clear the mini reporter unless the previous run had failures, or "r\n" was
entered on stdin.
* consistent empty lines in finish output
Always print two empty lines before each error/rejection/exception when the mini
and verbose reporters finish. Remove trailing whitespace from stack traces.
Always print an empty line after the finish output.
Add a test helper to more easily compare line output, with useful debug
information. At the moment this new helper is only used for failing tests.
* print line if reporter was not be cleared
Watch mode won't clear the mini reporter if there were errors, or "r\n" was
entered on stdin. The verbose reporter can't be cleared at all. To improve the
separation between multiple test runs, write a horizontal line when starting a
new test run and the reporter was not cleared.
* remove debug output from cli test
* extract files processing from api
* extract test-data class from API
* fix breakage from rebase
* pass testData to reporters in every method
* rename testData to runStatus
* runStatus.listenToTestRun => runStatus.observeFork
* rename test-data.js to run-status.js
* fix failing watcher test
This prevents interference between the mini logger and child processes that use `console.log`. The mini reporter previously used logUpdate which deletes lines previously written with the logUpdate API before writing a new one. This caused problems if lines from console.log were written inbetween logUpdate calls. It would delete the users log messages instead of the test status line. To fix this, we store the last written last log line, clear it, write the users log output, then restore the last log line. This keeps the miniReporter output always at the bottom of the log output.
It also fixes an incorrect use of the `child_process` API. We were using the `stdio` option for `child_process.fork`, but that option is ignored (it is honored for just about every other method in that API). See: 7b355c5bb3/lib/child_process.js (L49-L50)
It also adds a set of visual tests which can be run via `npm run visual`. They must be run manually, and should be run as part of our pre-release process.