I was working on the unit test setup for Lightning Web Components with Jest and tried to figure out how to get a code coverage report but found nothing in the Docs. By running:
sfdx-lwc-jest --coverage
I was able to receive the following coverage information in the terminal:
PASS force-app/main/default/lwc/helloWorld/__tests__/helloWorld.test.js
c-hello-world
✓ displays greeting (56 ms)
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
helloWorld.js | 100 | 100 | 100 | 100 |
---------------|---------|----------|---------|---------|-------------------
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 1.717 s
Ran all test suites.
However, I did not figure out how to get this as a report file.