Merge multiple NYC coverage files into one
Problem
Sending multiple coverage files to SeaLights might have a network cost and we will often prefer sending only one files. In order to do that, we will need to first merge all the NYC coverage files into one and then send it to SeaLights.
Solution
Install the istanbul-merge package
npm install istanbul-merge
Make a string variable including all the files to merge
json_files=$(find . ~+ -name "*.json" -print)
Run the merge command
istanbul-merge --out coverage.raw.json "$json_files"
Upload the file to SeaLights