address review comments
This commit is contained in:
parent
8db1eacd1c
commit
b14c4dcdc0
1 changed files with 7 additions and 9 deletions
|
@ -906,17 +906,15 @@ describe('net module', function () {
|
||||||
urlRequest.end()
|
urlRequest.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should throw if given an invalid redirect mode', function (done) {
|
it('should throw if given an invalid redirect mode', function () {
|
||||||
const requestUrl = '/requestUrl'
|
const requestUrl = '/requestUrl'
|
||||||
try {
|
const options = {
|
||||||
const urlRequest = net.request({
|
url: `${server.url}${requestUrl}`,
|
||||||
url: `${server.url}${requestUrl}`,
|
redirect: 'custom'
|
||||||
redirect: 'custom'
|
|
||||||
})
|
|
||||||
urlRequest
|
|
||||||
} catch (exception) {
|
|
||||||
done()
|
|
||||||
}
|
}
|
||||||
|
assert.throws(function () {
|
||||||
|
net.request(options)
|
||||||
|
}, 'redirect mode should be one of follow, error or manual')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should follow redirect when no redirect mode is provided', function (done) {
|
it('should follow redirect when no redirect mode is provided', function (done) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue