avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

No feedback from test timeout #2916

Closed homostellaris closed 2 years ago

homostellaris commented 2 years ago

If you set a timeout for an individual test using t.timeout you get feedback as I'd expect.

Error: Test timeout exceeded

But if you pass the timeout from the CLI it just prints a blank line and exits with code 1. You can reproduce by running npx ava timeout.test.js --timeout 1s on the following.

import test from 'ava'

test.cb('Test timeout', t => {
  setTimeout(t.end, 2000)
  t.assert(true)
})
mislav commented 2 years ago

The timeout failure seems printed in --verbose mode but not in regular mode. For now, -v could be used as temporary workaround.

Likely duplicate of https://github.com/avajs/ava/issues/2639

novemberborn commented 2 years ago

Due to this issues, AVA 4 has removed non-verbose mode and defaults to verbose. Which sort of "solves" the problem.