Nx: What is the equivalent of --coverage when using jest as test runner?

Created on 4 Jan 2019  路  3Comments  路  Source: nrwl/nx

After converting my app to use jest stead of karma. I see that in the jest.config.js, there is this line to indicate we are collecting coverage:

collectCoverage: true,

Instead of specifying that in the jest.config.js, I would like to use the --coverage option with jest cli instead.

I tried this but it doesn't work

ng test app1 --coverage
Unknown option: '--coverage'  

What is the correct way to specify coverage with calling a script instead of hardcoding it on jest.config.js?

Most helpful comment

--codeCoverage=true

All 3 comments

--codeCoverage=true

--codeCoverage=true did not work for me, has this changed?

--code-coverage works for me

Was this page helpful?
0 / 5 - 0 ratings