Ckeditor5: Coverage report shows files from beyond the glob

Created on 12 Dec 2017  路  5Comments  路  Source: ckeditor/ckeditor5

npm test -- --files link/link.js -c

Result:

=============================== Coverage summary ===============================
Statements   : 89.47% ( 170/190 )
Branches     : 73.33% ( 44/60 )
Functions    : 88.37% ( 38/43 )
Lines        : 89.25% ( 166/186 )
================================================================================

image

This makes text reporter a bit useless.

dev bug

Most helpful comment

giphy

All 5 comments

That's a glob for which test files to run. It's not always possible to match them with files in src/.

It might be simple if we agree to keep the same files structure in src and tests.

Something like:

const filesToCover = glob.sync( providedGlob )
    .forEach( path => path.replace( '/tests/', '/src/' ) );

It's also simple if we agree that we use simple CC stats for whole packages only ;). If you work with just one file, then you can open the results for that specific file.

With matching the src structure the problem is that sometimes we have more test files than src files. Not to mention cases where we test dev utils kept in tests/ or some other uncommon scenarios.

giphy

I feel so bad now ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oleq picture oleq  路  3Comments

pomek picture pomek  路  3Comments

MansoorJafari picture MansoorJafari  路  3Comments

metalelf0 picture metalelf0  路  3Comments

Reinmar picture Reinmar  路  3Comments