You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
280 B

4 years ago
  1. var Buffer = require('buffer').Buffer
  2. var test = require('tape')
  3. var http = require('../..')
  4. test('error handling', function (t) {
  5. var req = http.get('https://0.0.0.0:0/fail.txt')
  6. req.on('error', function (err) {
  7. t.ok(err && ('message' in err), 'got error')
  8. t.end()
  9. })
  10. })