ampproject / ampproject/amphtml

`expectAsyncConsoleError` not throwing error

Open
#28,438 7 comments 0 reactions 1 assignee Claimed by @rsimha View on GitHub
P3: When Possible Stale Type: Bug WG: infra
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

I tried to use the `expectAsyncConsoleError()` method, but it's not failing a unit test as I expected. Am I missing anything?

Here's my fake test (#28439 is the draft PR)
```
describe('test', () => {
afterEach(() => {
console.log('done');
});
it('my fake test', () => {
expectAsyncConsoleError('fake message');
});
});
```

The test passed. Got
![image](https://user-images.githubusercontent.com/5419904/81997455-a2960e00-9604-11ea-830c-bec6de638f5e.png)

When I tried to debug it, I noticed the test was run twice and failed the second time.
![image](https://user-images.githubusercontent.com/5419904/81997509-c8bbae00-9604-11ea-8ab1-adb3260073f7.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.