playwright-test-coverage icon indicating copy to clipboard operation
playwright-test-coverage copied to clipboard

Need help with uncovered files

Open aniketicloud opened this issue 1 year ago • 3 comments

With current setup, all files are not covered. For example, if Button.tsx is added, not Button test; then Button coverage is not showing at all. I tried include:: 'src/**/*', 'src/**/**/**/*.{ts,tsx,js,jsx}', 'src/*'

aniketicloud avatar Aug 10 '24 09:08 aniketicloud

please?

aniketicloud avatar Aug 11 '24 10:08 aniketicloud

I tried with this too. No luck. ctViteConfig: { plugins: [ react(), istanbul({ include: 'src/*', exclude: ['node_modules', 'test/'], extension: ['.js', '.ts', '.tsx'], forceBuildInstrument: true, nycrcPath: './.nycrc.json' }), ], },

and passing following in .nycrc.json { "all": true, "check-coverage": true }

aniketicloud avatar Aug 11 '24 13:08 aniketicloud

A bit late to the party here. But for me this was 100% a lazy loading issue.

If you don't already have one, create a global-setup.ts file (I named mine coverage-setup.ts) then import in your coverage fixture and add routes for all the areas you need (tedious but needed to work). Once you start creating tests for those routes you can remove them

jtgober avatar Sep 15 '25 16:09 jtgober