Open anil826 opened 4 years ago
I think the issue is only on Codeship CI locally same code is working fine. So not sure what is the issue here.
@anil826 I am having a similar issue locally when using superagent for testing. Couldn't figure out the issue too. Here is the snippet of my text code.
` const chai = require('chai'); const should = chai.should(); const request = require('superagent');
describe('User level Routes', function () { describe("index routes", function () { it("the / route should return a valid html page ", function () { request.get('/').then(function(response){ response.should.not.be.empty(); }).catch(function(error){ throw error; }) }) }) }) `
Running the above gives the following error
Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 80, response: undefined }
I updated the version of superagent with 0.1.x to 5.x.x but not sure why I am getting this error in my
catch
block.I am not sure if I am doing anything wrong I just replace
.end
to.then
and added the.catch
block.