Skip to content

t.timeout is ignored in test.before #2886

@fungiboletus

Description

@fungiboletus
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions