Open sk- opened 8 years ago
Hi!
Thank for issue. We have supported chrome properties since version 1.0. Please, update your dependencies.
You can do
var chrome = require('sinon-chrome');
chrome.runtime.lastError = new Error('error');
// reset all props
chrome.flush();
// or
chrome.runtime.lastError = undefined;
Note: in v.1.0 we remove all predefined props and behaviors
Note that the current support of chrome.runtime.lastError
does not help in complex cases, as you can only set one value.
If you want for example that the call to chrome.tabs.create
succeeds and then the call to chrome.storage.local.get
to fail then you would need to do something like what I first posted.
@sk- yes, you are right. Do you want to create pull request?
Currently there's no support for
chrome.runtime.lastError
.After importing
sinon-chrome
what I'm doing is the following:Feel free to grab that code.