cookie-monster
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var exports = module.exports = function (doc) { | ||
@@ -2,0 +4,0 @@ if (!doc) doc = {}; |
{ | ||
"name": "cookie-monster", | ||
"description": "Browserify-compatible module to get and set cookies in the browser", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"repository": { | ||
@@ -10,3 +10,3 @@ "type": "git", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "karma start" | ||
}, | ||
@@ -25,5 +25,11 @@ "main": "index.js", | ||
"devDependencies": { | ||
"bindpolyfill": "0.0.0", | ||
"chai": "^1.9.2", | ||
"mocha": "^1.21.5" | ||
"karma": "^0.12.24", | ||
"karma-browserifast": "^0.7.0", | ||
"karma-cli": "0.0.4", | ||
"karma-mocha": "^0.1.9", | ||
"karma-phantomjs-launcher": "^0.1.4", | ||
"karma-spec-reporter": "0.0.13" | ||
} | ||
} |
@@ -8,18 +8,12 @@ var cookie = require('../index'); | ||
describe('cookie monster', function() { | ||
var doc; | ||
var cookieMonster; | ||
beforeEach(function() { | ||
doc = {cookie: 'fakey=mcfakerson; dumby=mcdumberson'}; | ||
cookieMonster = cookie(doc); | ||
}); | ||
it('sets a cookie', function() { | ||
cookieMonster.set('cookieKey', 'cookieVal'); | ||
doc.cookie.should.equal('cookieKey=cookieVal'); | ||
cookie.set('cookieKey', 'cookieVal'); | ||
document.cookie.should.equal('cookieKey=cookieVal'); | ||
}); | ||
it('gets a cookie', function() { | ||
cookieMonster.get('dumby').should.equal('mcdumberson'); | ||
document.cookie = 'dumby=mcdumberson;'; | ||
cookie.get('dumby').should.equal('mcdumberson'); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6283
12
95
69
8