Fixes#948.
AVA does not support nested / async calls to `test`, but we were not providing a great error message when users attempted that.
* added failing test for expected error
* tests passed: waiting for review
* added test
* changed error message
* fixed error in test
* changed 'hasBegunRunning' to 'hasStarted'
* ava-files should honor a `cwd` option.
* Properly resolve test files in non-watch mode.
* update test/watcher.js to reflect new AvaFiles Api
* extract ava-files to it's own thing
This mostly reverts #815, and #827. The Node regressions they fixed were resolved in Node 6.2.0. The new behavior is just to print a warning message so people know how to fix it.
From the [`node-glob` docs](https://github.com/isaacs/node-glob#options):
> At the very least, you may pass in shared symlinks, statCache, realpathCache, and cache options, so that parallel glob operations will be sped up by sharing information about the filesystem.
* RunStatus#prefixTitle(), replace this.base only if it occurs at the beggining of path
* RunStatus#prefixTitle, filter out __tests__ from path
* added tests for RunStatus#prefixTitle
* 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
* refactor watcher tests
* move some methods from watcher to AvaFiles
* add some tests for ava-files
* add more test coverage
* fix linter error after merge
* PR Feedback
* use cross-platform split
* Basic macro support.
This adds basic macro support as discussed in #695.
It does not completely implement the spec outlined there, specifically:
- The macro can only specify the title using a function in `macroFn.title`. We discussed allowing `macroFn.title` to also be a string, and allowing some form of template language for extracting a title. However, using ES2015 string templates is already pretty easy, so we may just skip this.
- We discussed allowing groups of tests to be created using arrays.
Both the above proposals are found in [this comment](https://github.com/sindresorhus/ava/issues/695#issuecomment-205929738). They both enhance the implementation found in this commit, and would not break the contract. So I don't think there is anything preventing us from shipping this now.
* fix readme indentation
* spread arguments
* Allow arrays of macros
* pass providedTitle as first argument to title function.
* improve docs
If a non-function, non-promise, non-observable argument (i.e. a string) is passed to `t.throws`, the assertion passes. This obviously isn't what we want.
* change failing test hint
* mark .failing as code in readme
* group and reword failing tests
The tests are better when grouped together. I tried to give them more consistent titles too.
* remove spurious trailing space in t.end error message
Fixes#474
* add after.always, afterEach.always hook
* update readme about always modifier
* add test for verifying throw
* add tests for verifying always hook are added
* update readme for better "always" explaination
* fix typo in test/test-collection.js
* better always checking and implement
* modify error message for only
* fix build error
* add always to default in 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.