All Versions
50
Latest Version
Avg Release Cycle
96 days
Latest Release
31 days ago

Changelog History
Page 2

  • v6.1.0 Changes

    January 21, 2024

    What's Changed

    Full Changelog : v6.0.1...v6.1.0

  • v6.0.1 Changes

    December 06, 2023

    What's Changed

    • βœ… Ensure watch mode works outside of its integration tests by @novemberborn in #3273

    Full Changelog : v6.0.0...v6.0.1

  • v6.0.0 Changes

    December 04, 2023

    πŸ’₯ Breaking Changes

    • πŸ‘ AVA now requires Node.js versions 18.18, 20.8 or 21. Versions 14 and 16 are no longer supported. #3251 #3216

    • βœ… When tests finish, worker threads or child processes are no longer exited through proces.exit(). If your test file does not exit on its own, the test run will time out. #3260

    • πŸ”„ Changes to watch mode #3218:

    • Failed assertions now throw, meaning that any subsequent code is not executed. This also impacts the type definitions. #3246

    • Only native errors are now considered errors by the t.throws() and t.throwsAsync() assertions. Object.create(Error.prototype) is not a native error. #3229

    • πŸ”„ Changes to modules loaded through the require configuration #3184:

    πŸ‘Œ Improvements

    Rewritten watcher

    The watcher has been rewritten. It’s now built on fs.watch() in recursive mode.

    πŸ‘ @vercel/nft is used to perform static dependency analysis, supporting ESM and CJS imports for JavaScript & TypeScript source files. This is a huge improvement over the previous runtime tracking of CJS imports, which did not support ESM.

    πŸ— Integration with @ava/typescript has been improved. The watcher can now detect a change to a TypeScript source file, then wait for the corresponding build output to change before re-running tests.

    πŸ”§ The ignoredByWatcher configuration has moved to the watchMode object, under the ignoreChanges key.

    πŸ‘€ See #3218 and #3257.

    Failed assertions now throw

    βœ… Assertions now throw a TestFailure error when they fail. This error is not exported or documented and should not be used or thrown manually. You cannot catch this error in order to recover from a failure, use t.try() instead.

    All assertions except for t.throws() and t.throwsAsync() now return true when they pass. This is useful for some of the assertions in TypeScript where they can be used as a type guard.

    Committing a failed t.try() result now also throws.

    πŸ‘€ See #3246.

    t.throws() and t.throwsAsync() can now expect any error

    0️⃣ By default, the thrown error (or rejection reason) must be a native error. You can change the assertion to expect any kind of error by setting any: true in the expectation object:

    t.throws(()=\>{throw'error'},{any:true})
    

    πŸ‘€ See #3245 by @adiSuper94.

    πŸ”§ The require configuration is now more powerful

    It now loads ES modules.

    Local files are loaded through @ava/typescript if necessary, so you can also write these in TypeScript.

    πŸ”§ If there is a default export function, it is invoked after loading. The function is awaited so it can do asynchronous setup before further modules are loaded. Arguments from the configuration can be passed to the function (as a [structured clone](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone)).

    πŸ‘€ See #3184 by @sculpt0r.

    Other changes worth noting

    • πŸ‘€ Internal events can now be observed (experimentally). See #3247 by @codetheweb. It’s experimental and undocumented.
    • βͺ You can now use t.timeout.clear() to restore a previous t.timeout(). #3221
    • Code coverage is flushed to disk at opportune moments. #3220

    πŸ†• New Contributors

    Full Changelog : v5.3.1...v6.0.0

  • v3.14.0 Changes

    December 07, 2020

    Snapshot ordering

    πŸš€ With this release, snapshot files are now ordered based on test declaration, not completion. This makes it easier to compare the human-readable reports to your test file, and also stops the .snap from changing when the reports themselves don't. You'll want to rebuild snapshots after upgrading to this release to isolate any changes. Thanks @ninevra! e66b54c

    πŸ‘· Shared workers

    βœ… We’ve been working on making AVA more extensible. One major step on this path is our new shared worker support: run code in the main process, communicate with test workers and influence execution. Find out more in our shared workers recipe.


    πŸ‘€ See v3.13.0...v3.14.0 for all changes.

  • v3.13.0 Changes

    September 27, 2020
    • βœ… t.passed can now be used in tests and teardown functions. Thanks @tymfear! 900dc6d
    • In AVA 4, you'll no longer be able to pass null as the expectation for t.throws() & t.throwsAsync(). You can opt in to this early by enabling the disableNullExpectations experiment. Thanks @JSimoni42! f328a69
    • ⚑️ The Enzyme recipe has been updated. Thanks @jonathansamines! db5d2c3
    • ⚑️ The TypeScript recipe has been updated. Thanks @SephReed! a3379fa

    πŸ‘€ See v3.12.1...v3.13.0 for all changes.

  • v3.12.1 Changes

    August 23, 2020

    πŸ”§ Configure how AVA loads test files

    πŸ”§ Normally, AVA loads all files as CommonJS, except for mjs files and if you've configured "type": "module" in your package.json.

    As an experiment, you can now configure how AVA loads other file extensions. This is useful if you want to use Node.js' experimental loaders feature. Read more in our documentation. Thank you @macarie for working on this! 5c9dbb9

    πŸ›  Comparison bugfix

    πŸš€ There was a bug in our comparison library which meant that negative-index properties on lists were not compared. This was fixed in a patch release, which will definitely be installed when you install AVA 3.12. Your tests may have been passing, even though they should have been failing. They'll fail now. Snapshots may also be different, causing tests to fail.

    All changes

    πŸ‘€ See v3.11.1...v3.12.1 for all changes.

    Thank you @AnthumChris for making sure our ESM example used ESM syntax (20bc781).

  • v3.12.0

    August 23, 2020
  • v3.11.1 Changes

    August 03, 2020

    πŸš€ This release fixes corrupted output of the default reporter when test or program code writes to standard out. 5ddc9fd

    βœ… Also, thanks to @jonathansamines we've taken another step to using AVA to test AVA. 1150991

    πŸ‘€ See v3.11.0...v3.11.1 for all changes.

  • v3.11.0 Changes

    July 27, 2020

    πŸ†• New t.like() assertion

    Thanks to @futpib we now have a t.like() assertion 19c4f35:

    In the following example, the map property of value must be deeply equal to that of selector. However nested.qux is ignored, because it's not in selector.

    t.like({map: new Map([['foo', 'bar']]),nested: {baz: 'thud',qux: 'quux'}}, {map: new Map([['foo', 'bar']]),nested: {baz: 'thud',}})
    

    πŸ“š Read more in the t.like() assertion documentation.

    πŸš€ This assertion was previously introduced as an experiment.

    VSCode 1.47 debugging improvements

    πŸ“š You can now debug tests using the new JavaScript Debug Terminal in VSCode 1.47. We've updated our debugging recipe accordingly. Thank you @connor4312 for the documentation updates and your work on VSCode! bc39bcc

    All changes

    πŸ‘€ See v3.10.1...v3.11.0 for all changes.

  • v3.10.1 Changes

    July 05, 2020

    πŸš€ It's time for another AVA release πŸŽ‰

    ⚑️ Restricting when you can update snapshots

    When executing a subset of tests, through --match or or .only() or .skip(), you can no longer also update snapshots. This prevents you from accidentally deleting snapshots. Thank you @bunysae for putting this together. f72fab4

    ⚑️ If you are skipping a test that you can't immediately fix, but you still need to update snapshots, use .failing() instead.

    πŸ‘Œ Support for message strings in t.timeout() calls

    βœ… Thanks to @jonathansamines you can now provide a message string when using t.timeout(). This can be useful if your test depends on some other setup that may not have been completed: ca8ea45

    test('foo', t =\> {t.timeout(100, 'make sure database has started');// Write your assertions here});
    

    t.try() does not work in hooks

    t.try() has never worked in hooks, but thanks to @okyantoro it now fails properly instead of crashing. d01db61

    t.snapshot() does not really work in hooks either

    t.snapshot() sort of works in hooks, but we'll be removing this in AVA 4. You can opt in to this behavior by enabling the disableSnapshotsInHooks experiment. Again thank you @okyantoro d01db61.

    πŸ›  Fixed TypeScript definition for t.like()

    πŸ‘ The experimental t.like() assertion should now work better with TypeScript.

    All changes

    πŸ‘€ See v3.9.0...v3.10.1 for all changes.