karma-excel-export
v1.0.4
Published
Reporter that is used to export jasmine to excel
Downloads
3
Maintainers
Readme
karma-excel-reporter
Reporter that export data from jasmine into excel
Installation
The easiest way is to keep karma-excel-export
as a devDependency in your package.json
.
{
"devDependencies": {
"karma": "~0.10",
"karma-excel-export": "~0.1"
}
}
Configuration 1
// karma.conf.js
module.exports = function(config) {
config.set({
reporters: ['progress', 'excelExport'],
// the default configuration
excelExport: {
outputDir: 'karma_excel_export', // where to put the reports
reportName: 'report-summary-filename', // report summary filename; browser info by default
},
});
};
Configuration 2
// *.spec.ts
const myReporter = {
jasmineStarted: function(suiteInfo) {
console.log('Running suite with ' + suiteInfo.totalSpecsDefined);
},
jasmineDone: function(result) {
const excelData = [{
name: "John", age: 41,
}];
window['__karma__'].complete({type: 'excel', excelData: excelData})
}
};
jasmine.getEnv().addReporter(myReporter);
Example config in karma.config.js
plugins: [
require('karma-excel-export')
],
client: {
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/test10'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml', 'excelExport'],
excelExport: {
outputDir: require('path').join(__dirname, './excelReport'),
reportName: 'test.xlsx'
}
Contributors
Chatgpt https://jasmine.github.io/tutorials/custom_reporter https://karma-runner.github.io/2.0/dev/plugins.html