Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

375
Views
Uncaught Error: getaddrinfo ENOUTFOUND mysqldb

I am new making unit test for restapis. I tested the api manually and all is working fine, then I try to setup the unit tests but there is giving me errors for every request that involves my MySQL database.

this is my index.test.js

// imports...
chai.should();
chai.use(chaiHttp);

describe("Testing...", () => {

  describe("Basic test connection", () => {
    it("Should print server status", (done) => {
      chai.request(app)
        .get('/')
        .end((err, response) => {
          response.should.have.status(200);
          done();
        });
    });
  });

  describe("Test /artist GET", () => {
    it("Should print all artists", (done) => {
      chai.request(app)
        .get('/artists')
        .end((err, response) => {
          response.should.have.status(200);
          done();
        });
    });
  });
});

The first test passed, but then the second one give me the following error:

Uncaught Error: getaddrinfo ENOUTFOUND mysqldb
at GetAddInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26)

Would appreciate any comment

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!