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

121
Views
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 answers
Answer question

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 Report
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!