-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugcurrent functionality does not work as desiredcurrent functionality does not work as desiredhelp wantedscope:reporters
Description
First, thanks for maintaining such a great tool. So far it has addressed most of our javascript unit and integration test running needs.
What you're trying to do
I would like to see important test debug logs even if it times out.
What happened
Simple async test that will timeout because the promise resolves after 20 seconds. The test has a simple t.log()
invocation.
import test from 'ava';
test('example where logs are not provided by ava when test time out', async (t) => {
t.log({ message: 'Very important debug statement, that developer would love to see in output after test run' });
await new Promise((res) => {
console.log('start promise that resolves after timeout...');
setTimeout(res, 20000);
});
});
Simple test output (note ava is run with timeout=1s configured):
$ npx ava --timeout=1s --verbose
start promise that resolves after timeout...
✖ Timed out while running tests
1 tests were pending in test/example.js
◌ example where logs are not provided by ava when test time out
─
1 test remained pending after a timeout
What you expected to happen
I expected the output to contain the log: Very important debug statement, that developer would love to see in output after test run
.
Being able to see this log will be very helpful in determining why the test timed out.
Environment
package.json
{
"name": "ava-logging-timeout-bug",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"ava": "^4.3.3"
}
}
$ node -v
v16.16.0
$ npx ava --version
4.3.3
yquansah, kevo1ution, sarahannali and lorisleivakevo1ution and sarahannalikevo1ution and sarahannalikevo1ution and sarahannali
Metadata
Metadata
Assignees
Labels
bugcurrent functionality does not work as desiredcurrent functionality does not work as desiredhelp wantedscope:reporters