-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ability to set any cookie option
- Loading branch information
1 parent
698c998
commit 8fad04a
Showing
5 changed files
with
66 additions
and
14 deletions.
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
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,32 @@ | ||
import { getCookie, setCookie, stringifyOptions } from './index'; | ||
|
||
describe('#getCookie', () => { | ||
// TODO: add tests | ||
}); | ||
|
||
describe('#setCookie', () => { | ||
// TODO: add tests | ||
}); | ||
|
||
describe('#stringifyOptions', () => { | ||
it('should not include the days param', () => { | ||
expect( | ||
stringifyOptions({ | ||
days: 10, | ||
path: '/', | ||
}) | ||
).toEqual('; path=/'); | ||
}); | ||
|
||
it('should stringify any extra cookie options', () => { | ||
expect( | ||
stringifyOptions({ | ||
days: 7, | ||
path: '/test', | ||
SameSite: 'Lax', | ||
Secure: true, | ||
HttpOnly: false, | ||
}) | ||
).toEqual('; path=/test; SameSite=Lax; Secure'); | ||
}); | ||
}); |
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