Closed acvetkov closed 8 years ago
var chrome = require('sinon-chrome'); chrome.runtime.getUrl.returns('my-domain.com'); chrome.runtime.getUrl(); // my-domain.com chrome.flush() chrome.runtime.getUrl(); // undefined
But if we flush stubs, which has withArgs behavior, chrome.flush does not work.
chrome.flush
var chrome = require('sinon-chrome'); chrome.runtime.getUrl.withArgs(1).returns('my-domain1.com'); chrome.runtime.getUrl.withArgs(2).returns('my-domain2.com'); chrome.runtime.getUrl(1); // my-domain1.com chrome.runtime.getUrl(2); // my-domain2.com chrome.flush() chrome.runtime.getUrl(1); // my-domain1.com chrome.runtime.getUrl(2); // my-domain2.com
But if we flush stubs, which has withArgs behavior,
chrome.flush
does not work.