0.7.0
Breaking changes
There are some breaking changes in this release that significantly improves the test interface.
test() is now only for synchronous or promise/observable returning tests
The main test() interface is now synchronous by default and can be made asynchronous by returning a promise/observable or using a async/generator function (which implicitly returns a promise).
You no longer have to call t.end() in synchronous tests:
test(t => {
t.pass();
- t.end();
})You can no longer use test() for callback-style APIs, so we've introduced a new "callback mode" test.cb().
-test(t => {
+test.cb(t => {
fn(err => {
t.ifError(err);
t.end();
});
});t.plan() will no longer auto-end tests
You will now have to explicitly end tests with callback-style APIs. Previously, t.plan() doubled as both an assert counter and ending the test when the assertion count was reached. This was a mistake. It's now only an assert counter. We are now able to warn on too many async assertion which were previously not possible. Note that t.end() only works in "callback mode" test.cb().
-test(t => {
+test.cb(t => {
t.plan(1);
fn(err => {
t.ifError(err);
+ t.end();
});
});More info here: https://github.com/sindresorhus/ava#warning-recent-breaking-change
Highlights
- Test methods are now chainable. You can for example do
test.serial.skip(). d874ec9 - Use the local AVA version if available when running
$ avafrom the CLI. 2f7ac92 - Guard against time manipulation by mocking modules like Sinon. b88c2ba
- Improve the behavior of the
--serialflag. 7ad7501
