Skip to content

Commit 562fe89

Browse files
committed
tests: add test for single secret in array
1 parent 747f5a1 commit 562fe89

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: test/cookieParser.js

+12
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,18 @@ describe('cookieParser.signedCookies(obj, secret)', function () {
257257
})
258258

259259
describe('when secret is an array', function () {
260+
it('should include unsigned strings for matching secrets', function () {
261+
var obj = {
262+
buzz: 's:foobar.N5r0C3M8W+IPpzyAJaIddMWbTGfDSO+bfKlZErJ+MeE',
263+
fizz: 's:foobar.JTCAgiMWsnuZpN3mrYnEUjXlGxmDi4POCBnWbRxse88'
264+
}
265+
266+
assert.deepEqual(cookieParser.signedCookies(obj, ['keyboard cat']), {
267+
buzz: 'foobar',
268+
fizz: false
269+
})
270+
})
271+
260272
it('should include unsigned strings for all secrets', function () {
261273
var obj = {
262274
buzz: 's:foobar.N5r0C3M8W+IPpzyAJaIddMWbTGfDSO+bfKlZErJ+MeE',

0 commit comments

Comments
 (0)