Updating Chrome schemas
I'm attempting to write some tests for a Chrome Manifest V3 extension, but the current Chrome schemas exported by sinon-chrome are missing a number of newer APIs used by V3 extensions (e.g. chrome.action).
Are there any plans to update the schemas?
facing the same issue for chrome.action and others
Facing the same issue, any plans for this? Or can we submit a PR at least?
facing the same issue for
chrome.actionand others
You can use something like this in your global test setup file:
import chrome from 'sinon-chrome';
globalThis.chrome = chrome;
chrome.action = chrome.browserAction;
I think I wasn't able to do that and get typescript to compile still.
In the end, I had to do something more rote: https://github.com/melink14/rikaikun/blob/main/extension/test/chrome_stubs.ts
Sometimes I forget to import the correct 'fixed' stubbed chrome depending on how long between commits I am... :)