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

123
Vistas
How to get test result from mocha

I have a test. I use wdio and mocha. And I want after test to get my test result (pass or fail) and save in some varible. How does I can do it? I red mocha documentation and find this https://mochajs.org/api/runnable but I always has undefined result. I can`t understand how I should use it?

describe('some title', () => {
  it('some title', async () => {
    const runnable = new Runnable('some title', async () => {
      expect(await (await somePage1.someProp1).getText()).equal('some text 1');
      expect(await (await SomePage2.someProp2).getText()).equal('some text 2');
    });
    
    console.log(runnable.state);
  });
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use mochawesome for that. It's very efficient and outputs both JSON and styled elegant HTML reports.

You can install it globaly via npm

npm install -g mochawesome

And then run it

mocha --reporter mochawesome

More about mochawesome - https://github.com/adamgruber/mochawesome

about 4 years ago · Juan Pablo Isaza Denunciar
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