a Karma TAP Reporter and Prettifier
npm install karma-tap-pretty-reporter




> a Karma reporter plugin for report and prettify TAP test results
bash
npm install karma karma-tap karma-tap-pretty-reporter --save-dev
`$3
`bash
npm install faucet --save-dev
`Usage
Add
karma.conf.js file to project.Example:
`js
// karma.conf.js
module.exports = function(config) {
config.set({
reporters: ['tap-pretty'], tapReporter: {
prettify: require('faucet'), // default 'standard TAP' output
separator: '**'
},
});
};
`$3
On Karma autoWatch mode maybe we need separate test run cycles output. Create a separator string for this purpose.
> In order of not pollute output, separator will be shown only if LogLevel is different of LOG_INFO nor LOG_DEBUG$3
Optionally you can save report to a file and turn off output to the console.`js
// karma.conf.jsreporters: ['tap-pretty'],
tapReporter: {
outputFile: './test.out.tap',
disableStdout: true // default 'false'
},
`Supported
prettifiers
* faucet
* tap-spec
* tap-min
* tap-diff
* tap-notify
* tap-summary
* tap-markdown
* tap-diffletUse Cases
$3
Install tap-difflet package
`bash
npm install tap-difflet --save-dev
`
Add settings to tapReporter on karma.conf.js
`js
tapReporter: {
// outputFile: './unit.tap',
prettify: function() { return require('tap-difflet')({ pessimistic: true }); },
separator: '**',
},
``[ISC][isc-license]
[isc-license]:./LICENSE