Skip to content

Commit

Permalink
tests: add test for single secret in array
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Mar 15, 2020
1 parent 747f5a1 commit 562fe89
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/cookieParser.js
Expand Up @@ -257,6 +257,18 @@ describe('cookieParser.signedCookies(obj, secret)', function () {
})

describe('when secret is an array', function () {
it('should include unsigned strings for matching secrets', function () {
var obj = {
buzz: 's:foobar.N5r0C3M8W+IPpzyAJaIddMWbTGfDSO+bfKlZErJ+MeE',
fizz: 's:foobar.JTCAgiMWsnuZpN3mrYnEUjXlGxmDi4POCBnWbRxse88'
}

assert.deepEqual(cookieParser.signedCookies(obj, ['keyboard cat']), {
buzz: 'foobar',
fizz: false
})
})

it('should include unsigned strings for all secrets', function () {
var obj = {
buzz: 's:foobar.N5r0C3M8W+IPpzyAJaIddMWbTGfDSO+bfKlZErJ+MeE',
Expand Down

0 comments on commit 562fe89

Please sign in to comment.