clarkbw / jest-webextension-mock

A module to mock WebExtensions in Jest
BSD 3-Clause "New" or "Revised" License
93 stars 37 forks source link

tab.reload should resolve promise if no callback is provided #153

Closed rhelmer closed 2 years ago

rhelmer commented 2 years ago

I'm using webextension-polyfill and await browser.tab.reload() since it doesn't pass a callback when called this way. I've used the same pattern I see used in other parts of the codebase.

clarkbw commented 2 years ago

Can you add a related test? https://github.com/clarkbw/jest-webextension-mock/blob/main/__tests__/tabs.test.js#L106-L113

You can follow similar examples in there https://github.com/clarkbw/jest-webextension-mock/blob/main/__tests__/tabs.test.js#L36-L39