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);
}