Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var allCookies = [];
- function getAllCookies() {
- chrome.cookies.getAll({}, function(cookies) {
- for (var i in cookies) {
- allCookies.push(cookies[i])
- }
- }
- });
- }
- describe('getAllCookies', function() {
- beforeEach(function() {
- chrome = {
- cookies: {
- getAll : function() {
- return [
- 'cookie1',
- 'cookie2'
- ]
- }
- }
- };
- spyOn(chrome.cookies,'getAll');
- });
- it('should updated global variable allCookies', function() {
- getAllCookies();
- expect(allCookies).toEqual(['cookie1','cookie2'])
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement