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

425
Vistas
Is it possible to import a test to another file using jest?

Is it possible to import a test to another file using jest?

I need to create a file to use as a "test suite", using some tests from different files with the idea of ​​having a smoke test suite.

For example:

File 1:

describe('Test 1', function () {
  beforeAll(async () => {
    data = await csv().fromFile(
      './src/data/test.csv',
    );
  });

  it('Test 1.1', async function () {
    const testObject = await doSomething(data);

    expect(Array.isArray(testObject)).toBe(true);
  });
});

File 2:

describe('Test 2', function () {
  beforeAll(async () => {
    data = await csv().fromFile(
      './src/data/test.csv',
    );
  });

  it('Test 2.1', async function () {
    const testObject = await doSomething(data);

    expect(Array.isArray(testObject)).toBe(true);
  });
});

Test Suite:

A file to run tests 1.1 and 2.1.

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