Closed acvetkov closed 8 years ago
@vitalets @andre487
Append chrome.cookies plugin, that's emulate chrome cookies behavior. At first, you should install plugin to your chrome object
chrome.cookies
var chrome = require('sinon-chrome'); chrome.requirePlugin(new chrome.plugins.CookiePlugin());
Then just setup initial state like this
chrome.cookies.state = require('/path/to/cookies/array');
Then chrome.cookies methods will works like in browser environment.
Supports all methods:
chrome.cookies.get
chrome.cookies.getAll
chrome.cookies.set
chrome.cookies.remove
chrome.cookies.onChanged will be triggered like in browser environment too. Checkout tests for more info.
chrome.cookies.onChanged
update
:+1:
@vitalets @andre487
Append
chrome.cookies
plugin, that's emulate chrome cookies behavior. At first, you should install plugin to your chrome objectThen just setup initial state like this
Then
chrome.cookies
methods will works like in browser environment.Supports all methods:
chrome.cookies.get
chrome.cookies.getAll
chrome.cookies.set
chrome.cookies.remove
chrome.cookies.onChanged
will be triggered like in browser environment too. Checkout tests for more info.