fix: cookies.get should be able to filter domain (#20471)
* fix: use GetAllCookies when url is empty * test: get cookie without url
This commit is contained in:
parent
ebd55c1147
commit
5e11be6898
3 changed files with 45 additions and 20 deletions
|
@ -83,6 +83,16 @@ describe('session module', () => {
|
|||
expect(cs.some(c => c.name === name && c.value === value)).to.equal(true)
|
||||
})
|
||||
|
||||
it('gets cookies without url', async () => {
|
||||
const { cookies } = session.defaultSession
|
||||
const name = '1'
|
||||
const value = '1'
|
||||
|
||||
await cookies.set({ url, name, value, expirationDate: (+new Date) / 1000 + 120 })
|
||||
const cs = await cookies.get({ domain: '127.0.0.1' })
|
||||
expect(cs.some(c => c.name === name && c.value === value)).to.equal(true)
|
||||
})
|
||||
|
||||
it('yields an error when setting a cookie with missing required fields', async () => {
|
||||
const { cookies } = session.defaultSession
|
||||
const name = '1'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue