Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Aug 5, 2021
1 parent f50cc03 commit 0db311b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions test/node-fetch/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,19 @@ describe('node-fetch', () => {
return expect(fetch(url)).to.eventually.be.rejectedWith(TypeError, /Invalid URL/)
})

// it('should reject with error if protocol is unsupported', () => {
// const url = 'ftp://example.com/'
// return expect(fetch(url)).to.eventually.be.rejectedWith(TypeError, /URL scheme "ftp" is not supported/)
// })
it('should reject with error if protocol is unsupported', () => {
const url = 'ftp://example.com/'
return expect(fetch(url)).to.eventually.be.rejected
// .rejectedWith(TypeError, /URL scheme "ftp" is not supported/)
})

// it('should reject with error on network failure', function () {
// this.timeout(5000)
// const url = 'http://localhost:50000/'
// return expect(fetch(url)).to.eventually.be.rejected
// .and.be.an.instanceOf(FetchError)
// .and.include({ type: 'system', code: 'ECONNREFUSED', errno: 'ECONNREFUSED' })
// })
it('should reject with error on network failure', function () {
this.timeout(5000)
const url = 'http://localhost:50000/'
return expect(fetch(url)).to.eventually.be.rejected
// .and.be.an.instanceOf(FetchError)
// .and.include({ type: 'system', code: 'ECONNREFUSED', errno: 'ECONNREFUSED' })
})

// it('error should contain system error if one occurred', () => {
// const err = new FetchError('a message', 'system', new Error('an error'))
Expand Down

0 comments on commit 0db311b

Please sign in to comment.