-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using new Cookie(str) doesn't actually set the attributes in the cookie. This is because Cookie takes in an object, and in our case we only accept a string. Using Cookie.parse will return the appropriate properties for the cookie.
- Loading branch information
1 parent
d98c94d
commit 41e20a4
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
try { | ||
require('tough-cookie') | ||
} catch (e) { | ||
console.error('tough-cookie must be installed to run this test.') | ||
console.error('skipping this test. please install tough-cookie and run again if you need to test this feature.') | ||
process.exit(0) | ||
} | ||
|
||
var assert = require('assert') | ||
, request = require('../index') | ||
|
||
|
||
function simpleCookieCreationTest() { | ||
var cookie = request.cookie('foo=bar') | ||
assert(cookie.key === 'foo') | ||
assert(cookie.value === 'bar') | ||
} | ||
|
||
simpleCookieCreationTest() |