test: add test for invalid cookie url (#19568)

This commit is contained in:
Micha Hanselmann
2019-08-01 14:02:41 -07:00
committed by Samuel Attard
parent 5614ae4241
commit f2f483fedb

View File

@@ -145,6 +145,16 @@ describe('session module', () => {
expect(error).to.have.property('message').which.equals('Failed to get cookie domain')
})
it('yields an error when setting a cookie with an invalid URL', async () => {
const { cookies } = session.defaultSession
const name = '1'
const value = '1'
await expect(
cookies.set({ url: 'asdf', name, value })
).to.eventually.be.rejectedWith('Failed to get cookie domain')
})
it('should overwrite previous cookies', async () => {
let error
try {