import test from 'ava';
import { setTimeout } from 'timers';
test.before(async (t) => {
t.timeout(60_000);
await new Promise<void>((resolve) => setTimeout(() => resolve(), 50_000));
});
test('Works', (t) => {
t.is(1, 1);
});
Running the following code will fail instead of waiting 50 seconds.
t.timeout should perhaps be removed from the TypeScript definition of the t parameter in the test.before callback. But it would also be nice to be able to specify a timeout in a before block.