No change to logic. This swaps out utils.runScript() to return a Promise
instead of taking a callback. This also moves some of `test.cb()` cases
over to async functions instead.
This adds test coverage for the shell.exit() function. This also
refactors how we mock stdout/stderr and adds support for mocking
process.exit() (which was needed for this change).
While I was writing these tests, I realized there was an edge case I
missed in PR #1122. This change fixes that edge case.
Issue #1013
No change to production logic.
This renames test cases with duplicate names, deletes a redundant test,
and uses the public `t.title` API in favor of `t._test.title`.
This is a prerequisite for updating ava.
Issue #969
This fixes a conflict between mocks.init() and
utils.skipOnWin/skipOnUnix. mocks.init() mocks out process.stderr.write,
which utils.js implicitly depends on.
Instead, preserve stderr.write in a local variable to avoid polluting
mocked stdio and to correctly output warning messages.
Fixes#862
Test: locally apply mocks.init() inside test/which.js
This adds `skipOnWin` and `skipOnUnix` to help us manage our platform-dependent
tests. These methods give a nice warning message when we skip tests. We may also
consider adding warnings when running platform-dependent tests.
Part of the motivation for this is if we ever update to AVA v0.19. This version
requires at least one assertion per test case. While this could be disabled with
an AVA setting, we instead benefit from warnings for any case when we
unintentionally skip assertions.
This adds chalk as a dev dependency to enable colored messages.
* Add stdout/stderr test mocks
* Mock stdout/stderr during echo tests
* Fix lint issues
* Use 'use strict'
* Re-implement mocks as a prototype
* Implement mocks as a single-instance
* Remove redundant test
* Create mocked stdout/stderr.write methods once