Mocha list just missed the tests

I have hundreds of tests in mocha, dozens of which are skipped.

I would like to run the package, but only list the missing ones, so I can refer to them.

Does anyone know a way to achieve this? The command line flag does not seem to display

+4
source share
1 answer

Mocha comes with a built-in JSON reporter. The JSON output lists all the missing test cases. for example

mocha -R JSON > test-report.json

Here is the test file. report.json should have the following structure.

{
    stats: {...},
    tests: [...],
    pending: [...],
    failures: [...],
    passes: [...]
}

The pending key should have all the missing test cases.

+1
source

Source: https://habr.com/ru/post/1532245/


All Articles