Skip to content

Commit

Permalink
chore(test/supertest.js) obscure test removed
Browse files Browse the repository at this point in the history
  • Loading branch information
rimiti committed Jan 15, 2019
1 parent 50c59d6 commit 53feddc
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions test/supertest.js
Expand Up @@ -6,7 +6,6 @@ const should = require('should');
const express = require('express');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const nock = require('nock');

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

Expand Down Expand Up @@ -1161,28 +1160,4 @@ describe('request.get(url).query(vals) works as expected', function () {
done();
});
});

it('handles unknown errors', function (done) {
const app = express();

nock.disableNetConnect();

app.get('/', function (req, res) {
res.status(200).send('OK');
});

request(app)
.get('/')
// This expect should never get called, but exposes this issue with other
// errors being obscured by the response assertions
// https://github.com/visionmedia/supertest/issues/352
.expect(200)
.end(function (err, res) {
err.should.be.an.instanceof(Error);
err.message.should.match(/Nock: Not allow net connect/);
done();
});

nock.restore();
});
});

0 comments on commit 53feddc

Please sign in to comment.