Skip to content

1.0.0-beta.7

Pre-release
Pre-release

Choose a tag to compare

@novemberborn novemberborn released this 12 Aug 15:43
f7fce6a

Beta Seven 🖐🤞

We're getting really close now! As you may recall our 1.0 release has been in beta due to its dependency on Babel 7. Well, Babel 7 now has a release candidate! 🎉

AVA now supports Babel 7.0.0-rc.1. Before we can ship our 1.0 release there's just two issues left to tackle:

  • We need to make sure AVA works with babel.config.js files and update our documentation: #1816
  • We need to improve our cache invalidation when you change your Babel configuration: #1817

If you'd like to help get the 1.0 release over the line, please give us a shout in the respective issues.

Meanwhile, despite the release saying Beta, you really should be using this version. There won't be any fixes for the 0.x releases. Just be sure to install an exact dependency, as SemVer doesn't really apply to these betas:

$ npm install --save-dev --save-exact ava@next

Please see the release notes for the previous betas:

Highlights

Automatic spreading of test file runs across parallel CI jobs

AVA now automatically detects whether your CI environment supports parallel builds. Each build will run a subset of all test files, while still making sure all tests get executed. See the ci-parallel-vars package for a list of supported CI environments. c4f607c

Breaking changes

Asynchronous use of the t.throws() and t.notThrows assertions

Before this release, the t.throws() and t.notThrows() assertions supported promises and observables. AVA did require you to await calls to these assertions if you used them asynchronously (as of v0.19.0). We realized this behavior was both hard to explain and hard to express in Flow and TypeScript.

Therefore we've decided to make t.throws() and t.notThrows() work solely with synchronous exceptions. The new t.throwsAsync() and t.notThrowsAsync() assertions work with asynchronous assertions. To further simplify the implementation (and type definitions) we've removed support for observables. d5dd981 7babf6b

Generally speaking, you should be able to replace every occurence of await t.throws with await t.throwsAsync, and await t.notThrows with await t.notThrowsAsync. A transform file for jscodeshift is available in this Gist. Run it like:

$ npx jscodeshift -t https://gist.githubusercontent.com/novemberborn/c2cdc94020083a1cafe3f41e8276f983/raw/eaa64c55dfcda8006fc760054055372bb3109d1c/transform.js test.js

Change test.js to a glob pattern that matches your test files. See the jscodeshift CLI usage documentation for further details.

test export

We're no longer exporting the test() method as a named export. Where before you could use import {test} from 'ava', you should now write import test from 'ava'. d7c6b3d

Generator functions

We've dropped support for using generator functions as test implementations. This was a remnant of the dark days before async/await support. 02d768f

Dropped support for Node.js 9

Node.js 9 is no longer supported by Node.js itself. Per our support statement we're also dropping support in AVA. We're listing this here as a breaking change, but note that, in the future, we reserve the right to drop support for odd-numbered Node.js versions without bumping AVA's major version number. 359e14b

Bug fixes

  • Adding new snapshots no longer causes the Markdown files to become malformed. 223f992
  • User's esm settings no longer affect how we load the ava.config.js file. 6b6aa06
  • PromiseLike typing in Flow has been improved. e0f914a
  • AVA now detects when it's required from a Node.js REPL. 3ac2a8f
  • Better colors for use on light terminal themes. 76a8ce8
  • The assert module in Node.js 10 no longer crashes. 55e4021
  • Source maps, generated by AVA when compiling test & helper files, now contain correct paths to the source files. c9361cb
  • Watch mode now detects changes to test & helper files with custom extensions. 17a18de

All changes 📚

v1.0.0-beta.6...v1.0.0-beta.7

Thanks 💌

💖 Huge thanks to @CanRau, @coreyfarrell, @ivanschwarz, @jagoda, @jamiebuilds, @padmaia, @ronen and @sh7dm 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.