fix: properly bubble up cookie creation failure message (#37586)
This commit is contained in:
parent
48d0b09ad9
commit
b8f970c1c7
3 changed files with 22 additions and 7 deletions
|
@ -903,6 +903,16 @@ describe('net module', () => {
|
|||
expect(cookies[0].name).to.equal('cookie2');
|
||||
});
|
||||
|
||||
it('throws when an invalid domain is passed', async () => {
|
||||
const sess = session.fromPartition(`cookie-tests-${Math.random()}`);
|
||||
|
||||
await expect(sess.cookies.set({
|
||||
url: 'https://electronjs.org',
|
||||
domain: 'wssss.iamabaddomain.fun',
|
||||
name: 'cookie1'
|
||||
})).to.eventually.be.rejectedWith(/Failed to set cookie with an invalid domain attribute/);
|
||||
});
|
||||
|
||||
it('should be able correctly filter out cookies that are session', async () => {
|
||||
const sess = session.fromPartition(`cookie-tests-${Math.random()}`);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue