adana-format-text

Unit test coverage reporter for Adana.
Installation
npm install adana-format-text --save-dev
Usage
Similar to other adana coverage formatters, adana-format-text accepts an adana-compatible coverage results object and produces a report as utf8-encoded string.
cat coverage.json | adana --format text > report.txt
Add adana-format-text to the list of formatters in adana configuration object of the karma configuration file.
formatters: [
{
type: 'text',
save: 'reports/text-report.txt',
show: true
}
]
Usage in Node
import fs from 'fs';
import adanaFormatText from 'adana-format-text';
fs.readFile('coverage.json', 'utf8', (err, data) => {
const coverage = JSON.parse(data);
const report = adanaFormatText(coverage);
fs.writeFile('text-report.txt', report);
});
Note that if you're using ES5, you will have to access the library via the default
property due to the way exports are handled in Babel 6:
var adanaFormatText = require('adana-format-text').default;
License
MIT License