extend-chrome / jest-chrome

A complete mock of the Chrome API for Chrome extensions for use with Jest.
MIT License
124 stars 24 forks source link

chrome.runtime.id needs to be a string when using webextension-polyfill #8

Open AmySteam opened 3 years ago

AmySteam commented 3 years ago

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

When using webextension-polyfill you have to declare chrome.runtime.id as a string in jest.setup.js, like for example chrome.runtime.id = 'test id' if not you get the following error

Error: This script should only be loaded in a browser extension.

Describe the solution you'd like

I'd like it if jest-chrome could add a random default string or just a hard coded value so I wouldn't have to remember to add this id.