Sha256: 165b78707127db55d4a6eab7bd05d20b97592b7924f79aa592d2100677213a82

Contents?: true

Size: 735 Bytes

Versions: 19

Compression:

Stored size: 735 Bytes

Contents

var Cookie = require('../index')
  , assert = require('assert');

var str = 'Sid="s543qactge.wKE61E01Bs%2BKhzmxrwrnug="; Path=/; httpOnly; Expires=Sat, 04 Dec 2010 23:27:28 GMT';
var cookie = new Cookie(str);

// test .toString()
assert.equal(cookie.toString(), str);

// test .path
assert.equal(cookie.path, '/');

// test .httpOnly
assert.equal(cookie.httpOnly, true);

// test .name
assert.equal(cookie.name, 'Sid');

// test .value
assert.equal(cookie.value, '"s543qactge.wKE61E01Bs%2BKhzmxrwrnug="');

// test .expires
assert.equal(cookie.expires instanceof Date, true);

// test .path default
var cookie = new Cookie('foo=bar', { url: 'http://foo.com/bar' });
assert.equal(cookie.path, '/bar');

console.log('All tests passed');

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 node_modules/cookie-jar/tests/test-cookie.js
ela-4.1.5 node_modules/cookie-jar/tests/test-cookie.js
ela-4.1.4 node_modules/cookie-jar/tests/test-cookie.js
ela-4.1.3 node_modules/cookie-jar/tests/test-cookie.js
ela-4.1.2 node_modules/cookie-jar/tests/test-cookie.js
ela-4.1.1 node_modules/cookie-jar/tests/test-cookie.js
ela-4.1.0 node_modules/cookie-jar/tests/test-cookie.js
ela-4.0.0 node_modules/cookie-jar/tests/test-cookie.js
ela-3.4.3 node_modules/cookie-jar/tests/test-cookie.js
ela-3.4.2 node_modules/cookie-jar/tests/test-cookie.js
ela-3.4.0 node_modules/cookie-jar/tests/test-cookie.js
ela-3.3.1 node_modules/cookie-jar/tests/test-cookie.js
ela-3.3.0 node_modules/cookie-jar/tests/test-cookie.js
ela-3.2.0 node_modules/cookie-jar/tests/test-cookie.js
ela-3.1.1 node_modules/cookie-jar/tests/test-cookie.js
ela-3.1.0 node_modules/cookie-jar/tests/test-cookie.js
ela-3.0.0 node_modules/cookie-jar/tests/test-cookie.js
ela-2.0.0 node_modules/cookie-jar/tests/test-cookie.js
ela-1.1.0 node_modules/cookie-jar/tests/test-cookie.js