Skip to content

1.0.0-beta.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@novemberborn novemberborn released this 31 Jan 18:03
4d60d5d

1.0 (almost) 🏁

We've got some big news! With a gentle nudge from @razor-x we've decided to put up a 1.0 version. This will make it easier to push out patches and new features more regularly. We're also upgrading to Babel 7!

We're starting things off with a beta release. We'll keep the beta releases going until Babel 7 is out of beta itself. This version uses babel@v7.0.0-beta.39. If your use of AVA is coupled with your use of Babel 6 you'll have to stick with 0.25.0.

Many of our recipes are now out of date. There's a list of them in this issue. We'd love it if you could help us update these recipes.

We've also taken this opportunity to land some long-discussed breaking changes. A few more may be coming before we finish development on the 1.0 release. So exciting!

Babel-related changes

AVA now ships with Babel 7. This applies to test and helper file compilation. The Babel recipe has been updated with the latest details:

We'll now automatically use your project's Babel configuration. The "default" and "inherit" configuration values have been removed. Babel options must now be specified in a testOptions object. This will allow us to add source related options in the future.

You can disable ES module compilation:

{
  "ava": {
    "babel": {
      "testOptions": {
        "presets": [
          ["ava/stage-4", {"modules": false}]
        ]
      }
    }
  }
}

Our @ava/stage-4 preset is now accessible via ava/stage-4. We've added transforms for the latest ES2018 features where available. You can also disable ava/stage-4 entirely:

{
  "ava": {
    "babel": {
      "testOptions": {
        "presets": [
          ["ava/stage-4", false]
        ]
    }
    }
  }
}

The powerAssert option and command line flags have been removed. You can now disable AVA's test enhancements by setting compileEnhancements to false. If you do this enhancements you can disable AVA's Babel pipeline completely:

{
  "ava": {
    "babel": false,
    "compileEnhancements": false
  }
}

Tests must now have titles, and they must be unique

You can no longer do:

test(t => t.pass());

Instead all tests must have titles, and they must be unique within the test file:

test('passes', t => t.pass());

This makes it easier to pinpoint test failures and makes snapshots better too.

Note that AVA no longer infers a test title from a function name:

test(function myTest (t) {
  t.pass();
});

Configuration changes

As mentioned above, the powerAssert option has been removed, and the babel option has changed significantly. The source option has been renamed to sources. This is now consistent with files. AVA will exit with an error if it encounters the source option.

We've also removed unintentional support for init, watch and updateSnapshot options.

Supported Node.js versions

We've published a statement with regards to which Node.js versions we intend to support. As of this release we're only supporting Node.js 4.8.7 or newer, 6.12.3 or newer and 8.9.4 or newer. This does not include Node.js 5 and 7.

Remaining changes

  • t.throws() and t.notThrows() now accept functions that return observables or promises. The assertion will check them for errors. 40604ee
  • You can now specify helpers — that need to be compiled by AVA — in the require configuration. 56b56c1
  • Caches are shared between test and helper file globbing operations. This is a stop-gap measure that'll hopefully improve performance. a84c96f

All changes 📚

v0.25.0...v1.0.0-beta.1

Thanks 💌

💖 Huge thanks to @okyantoro for helping us with this release. We couldn’t have done it without you!

Get involved ✌️

We welcome new contributors. AVA is a friendly place to get started in open source. We have a great article on getting started contributing and a comprehensive contributing guide.