mirror of
https://github.com/encounter/phantomjs.git
synced 2026-03-30 11:35:11 -07:00
21 lines
464 B
JavaScript
21 lines
464 B
JavaScript
var assert = require('../../assert');
|
|
var cookiejar = require('cookiejar');
|
|
|
|
var jar = cookiejar.create();
|
|
assert.equal(jar.cookies.length, 0);
|
|
|
|
var cookie = {
|
|
'name' : 'Valid-Cookie-Name',
|
|
'value' : 'Valid-Cookie-Value',
|
|
'domain' : 'localhost',
|
|
'path' : '/foo',
|
|
'httponly' : true,
|
|
'secure' : false
|
|
};
|
|
|
|
jar.addCookie(cookie);
|
|
assert.equal(jar.cookies.length, 1);
|
|
|
|
jar.deleteCookie('Valid-Cookie-Name');
|
|
assert.equal(jar.cookies.length, 0);
|