Node.js TypeError: connect ECONNREFUSED 127.0.0.1haps000

I try to use zombie.js to enter the site, but I keep getting this error.

TypeError: connect ECONNREFUSED 127.0.0.1:3000

I think this has something to do with website security, but I'm not sure. Here is the code I'm using.

const Browser = require('zombie');
Browser.localhost('test.com', 3000);
describe('User visits signup page', function() {
const browser = new Browser();
before(function(done) {
    browser.visit('/', done);
});
describe('submits form', function() {
    before(function(done) {
        browser
        .fill('Username', '*******')
        .fill('password', '*******')
        .pressButton('Submit', done);
    });
    it('should be successful', function() {
        browser.assert.success();
    });
    it('should see welcome page', function() {
        browser.assert.text('title', 'Welcome To Brains Depot');
    });
  });
});
+4
source share
1 answer

, , . , nodemon . , zombie . , . , - :

const app = require('../../app');
const http = require('http').createServer(app).listen(3000);

, , .

+1

Source: https://habr.com/ru/post/1615888/


All Articles