All Versions
37
Latest Version
Avg Release Cycle
14 days
Latest Release
318 days ago

Changelog History
Page 3

  • v3.2.0 Changes

    February 02, 2020

    ๐Ÿš€ This release improves the integration with the new @ava/typescript package, which allows AVA to load pre-compiled TypeScript files.

    ๐Ÿ“ฆ First, install the new @ava/typescript package:

    npm install --save-dev @ava/[email protected]^1.1
    

    ๐Ÿ— Now let's assume your TypeScript files are in a src directory, output to a build directory. Configure AVA like so:

    ava.config.js file:

    export default { typescript: { rewritePaths: { 'src/': 'build/' } } }
    

    โœ… Compile your TypeScript files and run your tests! Or, to run a specific test file, run npx ava src/test.ts.

    ๐Ÿ‘€ For more examples see the @ava/typescript package.

    ๐Ÿ‘ As exciting as this is, it's still early days. We need your help improving our TypeScript support. Check out the open issues.

    Other changes

    ๐Ÿ‘€ See v3.1.0...v3.2.0 for all changes.

  • v3.1.0 Changes

    January 26, 2020

    AVA can now load pre-compiled TypeScript files!

    ๐Ÿ“ฆ First, install the new @ava/typescript package:

    npm install --save-dev @ava/typescript
    

    ๐Ÿ— Now let's assume your TypeScript files are in a src directory, output to a build directory. Configure AVA like so:

    ava.config.js file:

    export default { typescript: { rewritePaths: { 'src/': 'build/' } } }
    

    โœ… Compile your TypeScript files and run your tests! Or, to run a specific test file, run npx ava src/test.ts.

    ๐Ÿ‘€ For more examples see the @ava/typescript package.

    ๐Ÿ‘ As exciting as this is, it's still early days. We need your help improving our TypeScript support. Check out the open issues.

    Other changes

    Thanks to @jhechtf for fixing our TypeScript recipe after the changes in AVA 3.0 91a0086

    ๐Ÿ‘€ See v3.0.0...v3.1.0 for all changes.

  • v3.0.0 Changes

    January 19, 2020

    ๐Ÿฑ We're proud to introduce AVA 3! ๐Ÿš€

    ๐Ÿ‘ When we began AVA, JavaScript was very different. Most syntax you find familiar today was not supported by Node.js. Instead we relied on Babel to support that syntax before it made its way to Node.js itself.

    ๐Ÿ‘ These days most new stage-4 syntax is adopted quickly. It's often not necessary to transpile anything. Therefore we're removing our built-in Babel support from AVA itself.

    ๐Ÿ‘ Without Babel you'll have to resort to using require() functions in your JavaScript files. But, you say, Node.js 13 supports ECMAScript Modules!

    ๐Ÿ‘ Well, we're getting there. For a start, AVA now also looks for .cjs files. And .mjs files are recognized too, but can't be loaded just yet. This also impacts ava.config.js files. If you'd like to help out delivering full .mjs support check out the issues in the ESM support project.

    ๐Ÿš€ Removing Babel allowed us to simplify how test files are selected. Likely non-test files, inside "fixture" or "helper" directories are ignored. The same for files that are inside an underscore-prefixed directory. We've made some other breaking changes in this area so please do read the full release notes.

    ๐Ÿ”ง You can again pass glob patterns on the CLI. However these now filter the test files that AVA already selected based on the configuration. In other words you can't run files that wouldn't be run by invoking npx ava.

    ๐Ÿ”ง AVA now interrupts your tests if there's no progress for 10 seconds. Use the timeout configuration or --timeout CLI option to change this.

    ๐Ÿ†• New features

    Built-in debug mode

    โœ… You can now debug individual test files using the V8 Inspector:

    npx ava debug test.js
    

    ๐Ÿ“„ Connect to the debugger with Chrome DevTools. Or set up a debugger in VSCode.

    ๐Ÿ”ง Configurable Node.js arguments

    ๐Ÿ”ง You can now configure the arguments passed to Node.js itself when AVA starts its worker processes. Use the nodeArguments configuration or combine with the --node-arguments CLI option.

    All breaking changes

    ๐Ÿ‘Œ Supported Node.js versions

    ๐Ÿ‘ We now support Node.js 10, 12 and 13. The minimal versions are 10.18.0, 12.14.0 and 13.5.0 respectively.

    Removing Babel

    ๐Ÿ”ง Utilize Babel with AVA by installing our @ava/babel package and then enabling Babel by setting babel: true in the AVA configuration. Having this as a separate package means it can evolve independently.

    ๐Ÿ”ง The compileEnhancements setting has been moved into the babel configuration. Consequently, the t.assert() assertion will only print its detailed information when you use Babel. And we won't be able to catch typical mistakes with t.throws() as well as we could before.

    ๐Ÿ“ฆ The ava/stage-4 preset is now available from @ava/babel/stage-4. Our old @ava/babel-preset-transform-test-files and @ava/babel-preset-stage-4 packages are no longer maintained and not installed with AVA itself.

    ๐Ÿ‘ ECMAScript Module Support

    โœ… AVA now also looks for .cjs and .mjs test files. That said, .mjs files cannot be loaded just yet.

    Also, when you add "type": "module" , AVA would really like to treat .js files as ECMAScript Modules, but can't just yet.

    ๐Ÿ”ง Similarly,ava.config.cjs configuration files are now supported. ava.config.mjs files not just yet.

    With AVA 2, we loaded ava.config.js files using the esm package. To avoid confusion between the different module formats we now only support export default statements. No import, no __filename. Configuration files that have dependencies should be written as a .cjs file for now.

    ๐Ÿ”ง Configuration files can only have .cjs, .js and .mjs extensions.

    ๐Ÿ‘ The remaining work is tracked in the ESM support project.

    File selection

    ๐Ÿ”ง When you use the default configuration AVA will no longer select files matching the following glob patterns:

    • **/ __tests__ /** / __helper__ /**/*
    • **/ __tests__ /** / __helpers__ /**/*
    • **/ __tests__ /** / __fixture__ /**/*
    • **/ __tests__ /** / __fixtures__ /**/*
    • โœ… **/test/** /helper/**/*
    • โœ… **/test/** /helpers/**/*
    • โœ… **/test/** /fixture/**/*
    • โœ… **/test/** /fixtures/**/*
    • โœ… **/tests/** /helper/**/*
    • โœ… **/tests/** /helpers/**/*
    • โœ… **/tests/** /fixture/**/*
    • โœ… **/tests/** /fixtures/**/*

    Additionally, when a file has a parent directory that starts with a single underscore, it can never be a test file.

    ๐Ÿ“ฆ test.js files are only selected if they're next to the package.json file, or inside top-level src and sourcedirectories.

    ๐Ÿ”ง We've removed the configuration of helpers. Previously, files selected by the helpers glob patterns were never considered test files. Now that this configuration is no longer supported you'll need to ensure the files patterns exclude your helper files. If you're using Babel, you can configure the compilation of additional files .

    ๐Ÿ”ง The sources configuration has also been removed. Instead, use the ignoredByWatcher configuration. Changes to files matched by these glob patterns will not cause the watcher to rerun tests.

    Negated sources patterns must be used without the negation in ignoredByWatcher:

     export default {- sources: ['!examples/\*\*/\*']+ ignoredByWatcher: ['examples/\*\*/\*'] }
    

    CLI changes

    ๐Ÿ“ฆ Internally we've replaced meow by yargs. We're not expecting things to break because of this, but you never know.

    Resetting the cache

    The --reset-cache argument has been replaced by a proper reset-cache command:

    npx ava reset-cache
    

    File selection (again!)

    AVA again accepts glob patterns via the CLI:

    npx ava '\*\*/api/\*\*/\*'
    

    ๐Ÿ”ง The way this work is that AVA first finds all test files, according to the configuration, and then filters to select just the files that also match the glob patterns passed via the CLI.

    You can still pass paths to specific files:

    npx ava src/api/test/my-api-test.js
    

    ๐Ÿ”ง However unlike with AVA 2, you can no longer specify test files that aren't already selected by AVA's configuration.

    t.throws() and t.throwsAsync() assertions

    The second argument passed to these assertions must now be an expectation object. You can no longer pass the expected constructor, error message or regular expression.

    Other breaking changes

    • ๐Ÿ‘Œ Support for old esm versions has been removed.
    • โœ… We've set a default test timeout of 10 seconds. This means that if no test results are received for 10 seconds, AVA forces its worker processes to quit.
    • The NODE_PATH environment variable is no longer rewritten to ensure values are absolute paths.
    • ๐Ÿ‘ท AVA longer fakes the TTY in worker processes.

    Other changes

    • โšก๏ธ We've simplified how we identify observables. Any object returned by a test implementation that has a subscribe function is assumed to be an observable. AVA's type definition has been updated accordingly.
    • โœ… The TAP reporter now reports hook failures as test failures.
    • ๐Ÿ“„ We've added an example of module path mapping to our TypeScript recipe.
    • โœ… We've added a Selenium WebDriver JS recipe.

    All changes

    v2.4.0...v3.0.0

    Thanks

    โœ… Thank you @tymfear, @HeathNaylor, @grnch, @alexdrans, @MoppetX, @jimmywarting, @micaelmbagira, @aptester, @theashraf, @sramam and @maximelkin. We couldn't have done this without you!

  • v3.0.0-beta.2 Changes

    January 12, 2020

    ๐Ÿ— We've been busy building AVA 3. It comes with a fair amount of breaking changes but also some exciting features, like a built-in debug mode!

    ๐Ÿš€ This is the second beta release. It addresses the known issues from the first beta.

    ๐Ÿš€ Please read the 3.0.0 Beta 1 release notes first

    ๐Ÿ›  Fixes

    • t.assert() once again counts as a passed assertion
    • โšก๏ธ --update-snapshots works again
    • console and process are available in ava.config.js files

    โœจ Enhancements

    All changes

    v3.0.0-beta.1...v3.0.0-beta.2

    Thanks

    โœ… Thank you @aptester, @theashraf and @sramam. We couldn't have done this without you!

  • v3.0.0-beta.1

    January 05, 2020
  • v2.4.0 Changes

    September 16, 2019

    Experimental t.try() assertions

    โœ… Thanks to the amazing work and patience of @qlonik we're shipping a new assertion! t.try() lets you perform assertions and decide whether to commit or discard their outcome. All kinds of interesting things can be built on top of this, from fuzzy testers to new test interfaces and more.

    We're excited to get this out there, but it's not quite done yet. For now you have to opt in to this new feature. Being opt-in, we may make changes (breaking ones even!) until we feel this is stable.

    ๐Ÿ”ง To opt in, configure AVA with the following:

    ๐Ÿ“ฆ package.json:

    { "ava": { "nonSemVerExperiments": { "tryAssertion": true } } }
    

    ava.config.js:

    export default { nonSemVerExperiments: { tryAssertion: true } };
    

    We'd love to hear your feedback. Please join us in this issue: #2250

    Also, if you're looking to help out with the remaining issues so that we can ship this without the opt-in, have a look at this project: https://github.com/orgs/avajs/projects/1

    Thanks again @qlonik!

    Other changes

    All changes

    v2.3.0...v2.4.0

    Thanks

    Thank you @jeremenichelli, @jamesgeorge007, @dongjae93, @qlonik and @tryzniak. We couldn't have done this 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.

  • v2.3.0 Changes

    August 18, 2019

    ๐Ÿ”„ Changes

    • ๐Ÿ›  We've fixed some bugs to improve watch mode. ffa62ce 9e8d28f
    • โœ… AVA now prints an error when it receives non-existent test files on the command line. f01d05f
    • โœ… When using the TAP reporter, remaining tests are now included in failed test count. Failed hooks are no longer treated as test failures, and logs are printed. 8628976
    • ๐Ÿ–จ Internal errors that may occur for some edge cases are now printed. b27cb8d
    • ๐Ÿ‘ท TTY in the worker processes should follow the new APIs in Node.js 12.7.0 (when used with those Node.js versions). 7dcb473
    • ๐Ÿ‘ AVA now handles stage-4 syntax like dynamic import, and stage-3 syntax like BigInt, numeric separators and class properties that are supported by V8. 9baca8c
    • ๐Ÿ‘ AVA now supports dynamic import through our stage-4 preset.
    • ๐Ÿš€ AVA now uses [email protected]^3.0.2 which fixes issues with Lerna projects.
    • For our TypeScript users , we've changed the default type of t.context to unknown, in line with TypeScript's changes in their 3.5 release. 2fc7d56

    All changes

    v2.2.0...v2.3.0

    Thanks

    Thank you @MarchWorks, @yovasx2 and @bobthekingofegypt. We couldn't have done this 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.

  • v2.2.0 Changes

    July 08, 2019

    โœจ Enhancements

    โœ… You can now specify an alternative config file, using the --config CLI argument. This is useful if you want to run unit tests separately from integration tests, since you can have a config file specific to your integration tests which specifies different glob patterns. 2dae2bf

    ๐Ÿ› Bug fixes

    โœ… We're now faking the new hasColors() method for better compatibility with Node.js 12. d399797

    Node.js 11

    โฌ†๏ธ We've removed Node.js 11 from our test matrix. You should upgrade to Node.js 12. 90acbb9

    All changes

    v2.1.0...v2.2.0

    Thanks

    Thank you @langri-sha, @keyspress, @cdaringe and @okyantoro. We couldn't have done this 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.

  • v2.1.0 Changes

    June 10, 2019

    ๐Ÿ› Bug fixes

    • AVA's TypeScript definition now explicitly references the Node.js definition bb44da7

    โœจ Enhancements

    • โฑ Did you know you can provide human-readable timeout values? We've now documented this. 486acaf
    • We're now including all stack trace lines in the TAP output (though we still pre-process them). ac212ba
    • ๐Ÿ”Š Logs from successful hooks are now included in the TAP output. 007c7af
    • โšก๏ธ Our ESLint plugin helper has been updated to allow extensions and glob patterns to be overridden b3c9ea7

    All changes

    v2.0.0...v2.1.0

    Thanks

    Thank you @anishkny, @yovasx2 and @mihai-dinu. We couldn't have done this 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.

  • v2.0.0 Changes

    June 01, 2019

    ๐Ÿ’ฅ Breaking changes

    AVA now requires at least Node.js 8.9.4

    ๐Ÿš€ Per the Node.js release schedule, the 6.x releases reach end of live on April 30th. Consequently we've removed support in AVA. We are now testing with Node.js 12 though. 3a4afc6

    โœ… Test file and helper selection

    We've been working on simplifying how test files and helpers are selected. First off, the files option now only accepts glob patterns. If you configured it with directories before, please add /**/* to get the previous behavior.

    ๐Ÿ”ง The files and sources options must now be arrays containing at least one pattern. It's no longer possible to override a default exclusion pattern, but we're looking at making these configurable separately.

    โœ… AVA used to treat all files inside a helpers directory as test helpers. Finding these files could be really slow, however, and it also meant you couldn't have tests inside a helpers directory. Instead you can now specify glob paterns to find these helpers:

    { "ava": { "helpers": ["\*\*/helpers/\*\*/\*"] } }
    

    โœ… Test files starting with an underscore are still recognized as helpers.

    โœ… Files inside fixtures directories are no longer ignored, and will now be treated as test files. The watcher now also watches ava.config.js files.

    โœ… AVA now also selects files ending with .spec.js when looking for tests, as well as looking in tests directories. 08e99e5 b1e54b1

    The CLI now only takes file paths, not glob patterns.

    โšก๏ธ We'd like some help updating our ESLint plugin as well.

    Snapshots in CI

    โšก๏ธ When you run tests locally and add a new snapshot, AVA automatically updates the .snap file. However if you forget to commit this file and then run your CI tests, they won't fail because AVA quietly updates the .snap file, just like it does locally.

    ๐Ÿš€ With this release, AVA will fail the t.snapshot() assertion if it is run in CI and no snapshot could be found. 0804107

    Assertion messages must be strings

    ๐Ÿ‘€ AVA now enforces assertion messages to be strings. The message is only used when the assertion fails, and non-string values may cause AVA to crash. You may see test failures if you were accidentally passing a non-string message. 49120aa

    Flow type definitions

    ๐Ÿšš We've decided to remove the Flow type definitions from AVA itself. We don't have anybody to maintain them and consequently they've become a blocker when adding features to AVA. c633cf0

    We've set up a new repository from which we'll publish the definitions, but we need your help setting it up. If you use AVA and Flow, please join us in avajs/flow-typed#1.

    Observable typing

    โšก๏ธ Test implementations may return observables. We've updated our TypeScript definition to require these to have a Symbol.observable function. c2d8218

    ๐Ÿ†• New features

    ๐Ÿ”ง Configurable printing depth

    AVA now uses the util.inspect.defaultOptions.depth option when printing objects, so you can configure the depth. 98034fb

    Specify environment variables in your AVA config

    You can now specify environment variables in your config, using the environmentVariables object. a53ea15

    Other changes

    • We've added UntitledMacro and UntitledCbMacro types, for macro functions that will never have a .title function. Though really this just helped simplify the type definition. Thanks @qlonik! ebf4807
    • ๐Ÿ‘ท The dependency tracking in watch mode now respects custom require hooks you install in the worker processes. Thanks @lo1tuma! cb4c809
    • โœ… The TypeScript definition once again allows test.skip(macro) ba5cd80
    • ๐Ÿ‘• AVA now exposes some methods to our ESLint plugin, allowing our plugin to support the new test & helper file selection. 51433be

    All changes

    v1.4.1...v2.0.0

    Thanks

    Thank you @StoneCypher, @LukasHechenberger, @lo1tuma, @htor, @alexisfontaine and @grnch. We couldn't have done this 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.