@novemberborn novemberborn released this Nov 11, 2018 · 4 commits to master since this release

Assets 2

Release Candidate Two 🎷

Okay then, barring any surprises, the next release is the 1.0. But first, there's some changes we want to get out while we work on the celebratory blog post πŸ˜‰

Please give this release a try and let us know of any problems. And as always with pre-releases, be sure to install an exact dependency. However unlikely, there may still be breaking changes between now and the final 1.0 release:

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

Please see the release notes for the previous betas:

Highlights

Better snapshot files for pre-built files

We've improved how AVA builds snapshot files to better support precompiled projects. Say, if you compile your TypeScript test files using tsc before running AVA on the build output. AVA will now use the source map to figure out the original filename and use that as the basis for the snapshot files. You'll have to manually remove snapshots generated by previous AVA versions. a130a9e

Set default title using parameters syntax

Macros can generate a test title. Previously, AVA would call the title function with an empty string if no title was given in the test declaration. Now, it'll pass undefined instead. This means you can use default parameters. Here's an example:

import test from 'ava'

const failsToParse = (t, input) => {
	t.throws(parse(input))
}

failsToParse.title = (providedTitle = 'unexpected input') => `throws when parsing ${providedTitle}`

test('malformed', failsToParse, fs.readFileSync('fixtures/malformed.txt'))
test(failsToParse, Buffer.from('}', 'utf8'))

This is a breaking change if you were concatenating the provided title, under the assumption that it was an empty string. aa35f15

TypeScript now type-checks additional arguments used by macros

When using TypeScript, you must now type the arguments used by the macro 6f54db8:

import test, {Macro} from 'ava'

const failsToParse: Macro<[Buffer]> = (t, input) => {
	t.throws(parse(input))
}

failsToParse.title = (providedTitle = 'unexpected input') => `throws when parsing ${providedTitle}`

test('malformed', failsToParse, fs.readFileSync('fixtures/malformed.txt'))
test(failsToParse, '}') // ⬅️ fails to compile

Bug fixes and other improvements

All changes πŸ“š

v1.0.0-rc.1...v1.0.0-rc.2

Thanks πŸ’Œ

πŸ’– Huge thanks to @forresst, @sh7dm and @qlonik 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.