jest-chrome icon indicating copy to clipboard operation
jest-chrome copied to clipboard

`expect(chrome.runtime.onMessage.addListener).toHaveBeenCalled()`

Open fregante opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

I'm trying to test that a function is registering events, but it seem that this use case was not considered. The readme helpfully demoes the testing of events but not in the same way.

Describe the solution you'd like

addListener should be mocked so that I can expect calls on it

fregante avatar Jan 15 '23 19:01 fregante