Socket
Socket
Sign inDemoInstall

karma-tap-reporter

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.0.3

39

index.js

@@ -1,5 +0,25 @@

var TAPReporter = function(baseReporterDecorator) {
var TAPReporter = function(baseReporterDecorator, config, logger) {
var tapReporterConfig = config.tapReporter || {},
log = logger.create('karma-tap-reporter'),
_this = this,
output = '',
path = require('path'),
fs = require('fs'),
numbers, outputFile;
/**
* save all data that is coming in to the `data` variable for later use and
* proxy input to `this.write`
*/
function write(data) {
output = output + data;
_this.write(data);
}
if (tapReporterConfig.outputFile) {
outputFile = path.resolve(config.basePath, tapReporterConfig.outputFile)
}
baseReporterDecorator(this);
var numbers;
this.onRunStart = function() {

@@ -14,11 +34,11 @@ numbers = new Object();

this.specSuccess = function(browser, result) {
this.write("ok " + ++numbers[browser.id] + " " + result.suite.join(' ').replace(/\./g, '_') + " " + result.description + "\n");
write("ok " + ++numbers[browser.id] + " " + result.suite.join(' ').replace(/\./g, '_') + " " + result.description + "\n");
};
this.specFailure = function(browser, result) {
this.write("not ok " + ++numbers[browser.id] + " " + result.suite.join(' ').replace(/\./g, '_') + " " + result.description + "\n");
write("not ok " + ++numbers[browser.id] + " " + result.suite.join(' ').replace(/\./g, '_') + " " + result.description + "\n");
};
this.specSkipped = function(browser, result) {
this.write("ok " + ++numbers[browser.id] + " " + "# skip " + result.suite.join(' ').replace(/\./g, '_') + " " + result.description + "\n");
write("ok " + ++numbers[browser.id] + " " + "# skip " + result.suite.join(' ').replace(/\./g, '_') + " " + result.description + "\n");
};

@@ -31,7 +51,12 @@

});
this.write("1.." + total + "\n");
write("1.." + total + "\n");
if (outputFile) {
log.info('writing report to file: ' + outputFile);
fs.writeFileSync(outputFile, output);
}
};
};
TAPReporter.$inject = ['baseReporterDecorator', 'logger'];
TAPReporter.$inject = ['baseReporterDecorator', 'config', 'logger'];

@@ -38,0 +63,0 @@ module.exports = {

5

package.json
{
"name": "karma-tap-reporter",
"version": "0.0.2",
"version": "0.0.3",
"description": "A Karma plugin. Report results in TAP protocol.",

@@ -17,3 +17,4 @@ "main": "index.js",

"contributors": [
"lgersman <lars.gersmann@gmail.com> (http://www.orangevolt.com)"
"lgersman <lars.gersmann@gmail.com> (http://www.orangevolt.com)",
"Dmitrii Abramov"
],

@@ -20,0 +21,0 @@ "peerDependencies": {

@@ -12,3 +12,3 @@ # karma-tap-reporter

"karma": "~0.10",
"karma-tap-reporter": "~0.0.1"
"karma-tap-reporter": "~0.0.2"
}

@@ -27,2 +27,11 @@ }

```
Optionally you can save report to a file
```js
reporters: ['tap'],
tapReporter: {
outputFile: './unit.tap'
}
```
----

@@ -29,0 +38,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc