feat: promisify cookies api (#16464)
* feat: promisify the Cookie API * chore: update specs to test promisified cookies * chore: add deprecate wrapper for cookie callback API * docs: update docs to cookie promise changes * chore: remove redundant namespace use * docs: improve cookie example * docs: restore docs for cookie callback API * chore: restore cookie callback tests * fix: syntax of cookie promise return types
This commit is contained in:
parent
e2516dc808
commit
8396a2d504
8 changed files with 384 additions and 220 deletions
|
@ -550,12 +550,12 @@ describe('net module', () => {
|
|||
handleUnexpectedURL(request, response)
|
||||
}
|
||||
})
|
||||
|
||||
customSession.cookies.set({
|
||||
url: `${server.url}`,
|
||||
name: 'test',
|
||||
value: '11111'
|
||||
}, (error) => {
|
||||
if (error) return done(error)
|
||||
}).then(() => { // resolved
|
||||
const urlRequest = net.request({
|
||||
method: 'GET',
|
||||
url: `${server.url}${requestUrl}`,
|
||||
|
@ -575,6 +575,8 @@ describe('net module', () => {
|
|||
assert.strictEqual(urlRequest.getHeader(cookieHeaderName),
|
||||
cookieHeaderValue)
|
||||
urlRequest.end()
|
||||
}, (error) => {
|
||||
done(error)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue