Ava: Timeout message doesn't show which error timed out

Created on 1 Sep 2016  Â·  2Comments  Â·  Source: avajs/ava

Description

When ava fails because of a timeout, there's no way to know which test timed out

Test Source

import test from 'ava';

test('testing a test', async t => {
    t.true(await new Promise(() => {}));
});

Error Message & Stack Trace

$ ava --timeout 1s

   1 exception


   ✖ Exited because no new tests completed within the last 1000ms of inactivity

Config

None

Command-Line Arguments

$ ava --timeout 1s

Environment

OSX 10.11
ava 0.16.0
node v6.2.2
npm 3.10.6

Most helpful comment

I've updated #583 to also print pending tests after a timeout.

All 2 comments

AVA does not show which test timed out, because AVA does not track timeouts per test. What we do is, we reset one global timer every time the test finishes. So what AVA implements is actually a global idle timer. When no new tests have completed during a specified time frame, AVA fails with a timeout message.

Please check out the docs regarding timeouts: https://github.com/avajs/ava#global-timeout.

Although, I agree that this feature would be useful. Related: #583.

I've updated #583 to also print pending tests after a timeout.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dlumma picture dlumma  Â·  4Comments

sindresorhus picture sindresorhus  Â·  4Comments

sindresorhus picture sindresorhus  Â·  3Comments

electerious picture electerious  Â·  3Comments

fregante picture fregante  Â·  3Comments