Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

378
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda