Packages

ava

8.4.0 · 7 Nov 2026MIT575.3k / weekRepositoryHomepagenpmAtom feed

Your version

0.7.0

30 Nov 2015Where it was published

0.25.0 is the newest release of 0.7.x.

In short

1 breaking4 new

  • Breaking

    There are some breaking changes in this release that significantly improves the test interface.

Release note

!(cloud.githubusercontent.com/assets/170270/11463…)

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();
    });
 });

387c30a 7170308

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: github.com/sindresorhus/ava

f816815

Highlights

  • Test methods are now chainable. You can for example do test.serial.skip(). d874ec9

  • Use the local AVA version if available when running $ ava from the CLI. 2f7ac92

  • Guard against time manipulation by mocking modules like Sinon. b88c2ba

  • Improve the behavior of the --serial flag. 7ad7501

Changes

v0.6.1...v0.7.0

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.