1. lcov-result-merger
Merges multiple lcov results into one
lcov-result-merger
Package: lcov-result-merger
Created by: mweibel
Last modified: Mon, 20 Nov 2023 09:18:41 GMT
Version: 5.0.0
License: MIT
Downloads: 282,298
Repository: https://github.com/mweibel/lcov-result-merger

Install

npm install lcov-result-merger
yarn add lcov-result-merger

LCOV Result Merger

npm version
Build Status
Coverage Status
js-standard-style
semantic-release

When you have multiple test suites for the same application you still want to
have the code coverage across all testsuites.

This tool will handle this for you.

Usage

 ./node_modules/.bin/lcov-result-merger 'FILE_PATTERN' ['OUTPUT_FILE']

Examples

Use stdout

  1. Generate LCOV Code Coverage into different files, e.g. build/coverage/coverage_X.log
  2. Run ./node_modules/.bin/lcov-result-merger 'build/coverage/coverage_*.log'
  3. Use the stdout to pipe it to e.g. Coveralls
  4. Done.

Use merged output file

  1. Generate LCOV Code Coverage into different files, e.g. build/coverage/coverage_X.log
  2. Run ./node_modules/.bin/lcov-result-merger 'build/coverage/coverage_*.log' 'target/coverage/coverage_merged.log'
  3. Done. Enjoy your merged file.

Prepend source file paths

Modify source file paths to be relative to the working directory that the merge operation was run in. Useful in
monorepos where each child package gathers its own metrics.

 ./node_modules/.bin/lcov-result-merger 'FILE_PATTERN' ['OUTPUT_FILE'] --prepend-source-files

Since coverage output is rarely written directly into the project root, use --prepend-path-fix to describe the
relative path between the lcov file and the project root. The default simply points to one directory up, "..", which
works well for common tools such as NYC that write to a /coverage directory.

 ./node_modules/.bin/lcov-result-merger 'FILE_PATTERN' ['OUTPUT_FILE'] --prepend-source-files --prepend-path-fix "../src"

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin