acvetkov / sinon-chrome

Testing chrome extensions with Node.js
ISC License
435 stars 46 forks source link

Plugin cookies #19

Closed acvetkov closed 8 years ago

acvetkov commented 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

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.onChanged will be triggered like in browser environment too. Checkout tests for more info.

acvetkov commented 8 years ago

update

vitalets commented 8 years ago

:+1:

andre487 commented 8 years ago

:+1: