Cover READMEFeaturesAnnotates source files with Istanbul code coverage results. Highlights can be toggled via Ctrl-F1 RequirementsYour project must be using Istanbul and output the results to .nyc_output. Now also looks for a jest coverage output. (a 'coverage' folder) Also works with c8, as long as the json is output. (Also output to 'coverage' folder) Normally this is just a matter of putting nyc in front of your mocha (or other test runner) call. Using NYC/Istanbul with mochanpm i nyc nyc --reporter=text mocha Using C8 with mochanpm i c8 c8 mocha c8 --reporter=json mocha Do not use --reporter=text (as this suppresses needed json output.)Using JestIf you are using jest you can now run: jest --coverage Adding the following to your jest.config.js config will make jest create coverage reports for source files that lack any tests. collectCoverage: true, // Enable coverage collection collectCoverageFrom: [ "src//*.{js,jsx,ts,tsx}", // Adjust the path according to your project structure "!src//*.d.ts" // Exclude TypeScript declaration files ] Known IssuesDoesn't yet contain any configuration options. Currently only displays (lack of) statement coverage and doesn't show lack of branch coverage. Release Notes0.0.1Initial release of Cover. 0.0.2Allow toggling highlighting via Ctrl-F1 0.0.4Display coverage in all open copies of a files, rather than just the first one. 0.0.6Add support for jest test coverage output. (jest --coverage) Note: Will now look for a '.nyc_output' folder first in project root dir, and if not found will then look for folder named 'coverage'. 0.0.7Minor bug fix, and readme update, to document c8 support. |