Skip to content

Timeouts shouldn't hide assertion failuresΒ #1997

Open
@Marsup

Description

@Marsup

Issuehunt badges

Prerequisites

I checked other issues and couldn't find something similar, although #1485 is slightly related and is genuinely both surprising and completely counter-intuitive to me, but I'm not going to start this debate again.

Description

Test timeouts are hiding failed assertions.

Test Source

test('foo', t => {
  t.is(1, 2);
  return new Promise(() => {
    function f() {
      setTimeout(f, 10);
    }
    f();
  });
});

Error Message & Stack Trace

βœ– Exited because no new tests completed within the last 2000ms of inactivity

That's all there is, no trace of the assertion.

Command-Line Arguments

ava --timeout=2s

Environment

Node.js v10.14.1
linux 4.18.0-12-generic
1.0.0-rc.2
6.4.1

There is a $40.00 open bounty on this issue. Add more on Issuehunt.

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