Skip to content

0.17.0

Compare
Choose a tag to compare
@sindresorhus sindresorhus released this 17 Nov 08:59
· 1151 commits to main since this release

The current working directory in test files changed (BREAKING)

We made the hard decision of changing the current working directory (process.cwd()) in test files to be the same directory as package.json. It was previously the same as __dirname (the directory of the test file). Having process.cwd() equal __dirname felt like a good idea at the time, but as the popularity of AVA grew, people started hitting issues with it.

This affects users that have test files in a sub-folder and are using relative paths. If you have your test files in the same directory as package.json, you're fine.

The fix is to wrap all relative paths in path.join(__dirname, 'relative-path') to make them absolute.

Here's an example of what needs changing. The below file and unicorn.txt are both in ./test/.

-t.true(fs.existsSync('unicorn.txt'));
+t.true(fs.existsSync(path.join(__dirname, 'unicorn.txt')));

Let us know if anything is unclear or if you're having problems.

Commit: 476c653

Node.js version support

The next minor version of AVA, 0.18.0, will drop support for Node.js v0.10 and v0.12. We'll continue fixing critical issues for this version until the end of the year. Time to upgrade if you haven't. (Discussion: #1051)

Highlights

  • We now have a script to automatically migrate from tape to AVA.
  • Our ESLint plugin received two new rules:
  • Reduced transpilation on Node.js >=4. AVA now only transpiles what's needed for Node.js 4 when on it or higher, which should result in better performance and stacktraces. 4025d81
  • Removed the --require CLI flag. Configure it in package.json instead. 17119bc
  • Switched to lodash.isEqual for deep equality checking (t.deepEqual() & t.notDeepEqual()). This might make your test fail if our previous deep equality check was too loose. 8856684
  • Improvements to the test failure output. e4f90e0 (We're currently working on many more improvements in this area. Stay tuned.)
  • Added option to disable power-assert. 24a38ac
  • Correctly clean up stacktraces on Node.js 6 and higher. 26bcab0
  • Removed t.doesNotThrow() as it was renamed to t.notThrows(). It was deprecated far back in AVA 0.12.0. e448798
  • Deprecated t.error() alias for t.ifError(). It will be removed in AVA 1.0.0. Just use t.ifError(). 28bb0d5 (We have an automatic migration script if you're using t.error())
  • Ensures test files load correct AVA installation. This means you can now run AVA with an absolute path and it will still use the local AVA installation at that path if available. 3ea2ba1
  • Added support for debugging tests with WebStorm and added a recipe. c268c8d
  • Added Flow type defintion. 6458454
  • Improvements to the TypeScript type definition. 4baa170 8816faf c40477a
  • We started exploring browser support. 204f2be

All Changes

v0.16.0...v0.17.0