Skip to content

allowConsoleError should capture async errors #15609

@lannka

Description

@lannka

The following code illustrate the problem, where we expect a console error, but it actually might leak to outside of this test.

it('abc', () => {
  allowConsoleError(() => {
     asyncFuncThatPrintsConsoleError();
  });
})

function asyncFuncThatPrintsConsoleError() {
  setTimeout(() => {
     console.error('errr!!!')
  }, 1);
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions