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

Changelog History
Page 2

  • v3.8.1 Changes

    April 26, 2020

    πŸ‘ Node.js 14 support

    πŸš€ Great news, this is a feature heavy release!

    πŸ‘ First off, though, AVA now officially supports Node.js 14. Thank you @zackschuster! 2e7c76b

    βœ… Run tests at specific line numbers

    🍱 AVA can now run tests at specific line numbers! πŸŽ‰

    βœ… Given the following test file:

    βœ… test.js

    1: test('unicorn', t =\> {2:t.pass();3: });4:5: test('rainbow', t =\> {6:t.fail();7: });
    

    βœ… Running npx ava test.js:2 for would run the unicorn test. In fact you could use any line number between 1 and 3.

    πŸ‘€ This feature is only available from the command line. It won't work if you use tools like ts-node/register or @babel/register, and it does not currently work with @ava/babel and @ava/typescript. See #2473.

    Thank you @ulken for your hard work and patience to get this shipped. 1222ce9

    βœ… Test-specific teardown functions

    Sometimes tests have side-effects you want to clean up. @ulken has implemented t.teardown() which lets you register teardown functions within your test. They'll run once your test has finished, even if it failed: 75cbc3b

    test('read file', t => {
        fs.writeFileSync('file.txt', 'πŸ‘‹');
        t.teardown(() => fs.unlinkSync('file.txt');
    
        // Run assertions
    });
    

    Node.js internal in stack traces

    🚚 Thanks to @bunysae, stack traces now include Node.js internals. Previously we removed them because we wanted you to focus on your own code, but quite often they do provide context. Now they're displayed, but somewhat dimmed. 9a9351d

    0️⃣ Watch mode with the default reporter

    0️⃣ Watch mode with the default reporter once again accepts key input. Thanks @pcdevil! 59c227d

    ICYMI

    βœ… afterEach() and afterEach.always() hooks can now determine whether the test passed. Thank you @bunysae for contributing this! 8f312c0

     test('passes', t =\> t.pass()); test.afterEach(t =\> { if (t.passed) { // Do something because the test passed } else { // Do something because the test failed } });
    

    βœ… If you've ever wanted to save some files along with AVA's snapshots, you can now determine the directory path by accessing test.meta.snapshotDirectory. Thank you @ulken! cb5f9f7

    All changes

    πŸ‘€ See v3.7.1...v3.8.1 for all changes.

  • v3.8.0 Changes

    April 26, 2020

    πŸ‘ Node.js 14 support

    πŸš€ Great news, this is a feature heavy release!

    πŸ‘ First off, though, AVA now officially supports Node.js 14. Thank you @zackschuster! 2e7c76b

    βœ… Run tests at specific line numbers

    🍱 AVA can now run tests at specific line numbers! πŸŽ‰

    βœ… Given the following test file:

    βœ… test.js

    1: test('unicorn', t =\> {2:t.pass();3: });4:5: test('rainbow', t =\> {6:t.fail();7: });
    

    βœ… Running npx ava test.js:2 for would run the unicorn test. In fact you could use any line number between 1 and 3.

    πŸ‘€ This feature is only available from the command line. It won't work if you use tools like ts-node/register or @babel/register, and it does not currently work with @ava/babel and @ava/typescript. See #2473.

    Thank you @ulken for your hard work and patience to get this shipped. 1222ce9

    βœ… Test-specific teardown functions

    Sometimes tests have side-effects you want to clean up. @ulken has implemented t.teardown() which lets you register teardown functions within your test. They'll run once your test has finished, even if it failed: 75cbc3b

    test('read file', t => {
        fs.writeFileSync('file.txt', 'πŸ‘‹');
        t.teardown(() => fs.unlinkSync('file.txt');
    
        // Run assertions
    });
    

    Node.js internal in stack traces

    🚚 Thanks to @bunysae, stack traces now include Node.js internals. Previously we removed them because we wanted you to focus on your own code, but quite often they do provide context. Now they're displayed, but somewhat dimmed. 9a9351d

    0️⃣ Watch mode with the default reporter

    0️⃣ Watch mode with the default reporter once again accepts key input. Thanks @pcdevil! 59c227d

    All changes

    πŸ‘€ See v3.7.1...v3.8.0 for all changes.

  • v3.7.1 Changes

    April 19, 2020

    v3.7.0...v3.7.1

  • v3.7.0 Changes

    April 13, 2020

    βœ… If you've ever wanted to save some files along with AVA's snapshots, you can now determine the directory path by accessing test.meta.snapshotDirectory. Thank you @ulken ! cb5f9f7

    πŸ‘€ See v3.6.0...v3.7.0 for all changes.

  • v3.6.0 Changes

    April 05, 2020

    βœ… afterEach() and afterEach.always() hooks can now determine whether the test passed. Thank you @bunysae for contributing this! 8f312c0:

    test('passes', t =\> t.pass());test.afterEach(t =\> { if (t.passed) { // Do something because the test passed } else { // Do something because the test failed } });
    

    πŸ“š @mbiesiad has diligently translated our documentation to Polish. Thank you @kekuu for reviewing.

    πŸ“š Also thank you @timgates42 for fixing a typo in our documentation. ede4f32

    πŸ‘€ See v3.5.0...v3.6.0 for all changes.

  • v3.5.2

    March 30, 2020
  • v3.5.1

    March 22, 2020
  • v3.5.0 Changes

    March 01, 2020

    When using ava debug, you can now specify the address or hostname the inspector is available through by using the --host option. Thanks to @DYefimov for contributing this! 13d6651

    πŸ‘€ See v3.4.0...v3.5.0 for all changes. Spoiler alert: it's just this one πŸ˜‰

  • v3.4.0 Changes

    February 23, 2020

    Introducing the t.try() assertion

    The new t.try() allows you to try assertions without causing the test to fail:

    test('do the thing', async t =\> { const attempt = () =\> t.try(tt =\> { const result = await getResult() // getResult() can be flaky and sometimes throws :(tt.is(result, 'expected') }) const firstAttempt = await attempt() if (firstAttempt.passed) return firstAttempt.commit() t.log('Retrying (just once)') firstAttempt.discard() const secondAttempt = await attempt() secondAttempt.commit() })
    

    βœ… You can use any test implementation with t.try(), including (arrays of) macros. You can decide what to do with attempts. You can even run attempts concurrently, so long as they don't use snapshot assertions.

    πŸ“š This is great building block for handling all kinds of advanced test scenarios. We can't wait to see what you'll do with it! Find out more in the assertion documentation.

    πŸš€ This feature was previously behind an experimental flag. That flag has now been removed. If you have enabled the flag you'll have to update your AVA config. Also note that as of this release, attempt titles are always prefixed with the title of the parent test 7ee3a0e.

    Once again, thank you @qlonik for contributing this new assertion.

    πŸ‘ In case you missed it: ESM support

    πŸš€ As of the 3.3.0 release, AVA can load ESM test files! Check our updated ES Modules recipe for details.

    πŸ‘ Our ESM support is still incomplete. Progress is tracked in the ESM support project. Join us, won't you?

    Other changes

    • The t.throws() and t.throwsAsync() assertions can now be called with undefined as the second argument. Previously, if you wanted to set an assertion message but did not want to provide any expectations for the thrown error you had to pass null. That's still allowed, of course. d0e2161 @stavalfi
    • πŸ“¦ ava.config.js files once again work with our @ava/typescript package f4d4edd
    • Our TypeScript definition no longer references @types/node 7a1dacf
    • βœ… We've improved the error message shown when test.cb() is used with asynchronous functions or observables f5a8c2b @toddkcarlson
    • ⚑️ The Vue recipe has been updated to use jsdom-global instead of browser-env 3f9c616 @Scrum
    • ⚑️ @fisker optimized how we detect ESM support 8831f54

    πŸ‘€ See v3.3.0...v3.4.0 for all changes.

  • v3.3.0 Changes

    February 09, 2020

    ⚑️ AVA can now load ESM test files! πŸŽ‰Thank you @arlac77 for making this happen. Check our updated ES Modules recipe for details.

    πŸ‘ Our ESM support is still incomplete. Progress is tracked in the ESM support project. Join us, won't you?

    Other changes

    πŸ‘€ See v3.2.0...v3.3.0 for all changes.