Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xunit-file

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xunit-file - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

test/fixture/success/success.spec.js

35

lib/xunit-file.js

@@ -11,4 +11,5 @@ /**

, fs = require("fs")
, path = require("path")
, mkdirp = require("mkdirp")
, filePath = process.env.XUNIT_FILE || config.file || process.cwd() + "/xunit.xml"
, fd = fs.openSync(filePath, 'w', 0755)
, consoleOutput = config.consoleOutput || {};

@@ -43,4 +44,7 @@

, tests = []
, self = this;
, fd;
mkdirp.sync(path.dirname(filePath));
fd = fs.openSync(filePath, 'w', 0755);
runner.on('suite', function(suite){

@@ -75,3 +79,3 @@ if(consoleOutput.suite){

appendLine(tag('testsuite', {
appendLine(fd, tag('testsuite', {
name: process.env.SUITE_NAME || 'Mocha Tests'

@@ -86,4 +90,7 @@ , tests: stats.tests

tests.forEach(test);
appendLine('</testsuite>');
tests.forEach(function(test){
writeTest(fd, test);
});
appendLine(fd, '</testsuite>');
fs.closeSync(fd);

@@ -103,3 +110,3 @@ });

function test(test) {
function writeTest(fd, test) {
var attrs = {

@@ -114,8 +121,8 @@ classname: test.parent.fullTitle()

var err = test.err;
appendLine(tag('testcase', attrs, false, tag('failure', { message: escape(err.message) }, false, cdata(err.stack))));
appendLine(fd, tag('testcase', attrs, false, tag('failure', { message: escape(err.message) }, false, cdata(err.stack))));
} else if (test.pending) {
delete attrs.time;
appendLine(tag('testcase', attrs, false, tag('skipped', {}, true)));
appendLine(fd, tag('testcase', attrs, false, tag('skipped', {}, true)));
} else {
appendLine(tag('testcase', attrs, true) );
appendLine(fd, tag('testcase', attrs, true) );
}

@@ -131,3 +138,3 @@ }

, pairs = []
, tag;
, result;

@@ -138,5 +145,5 @@ for (var key in attrs) {

tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;
if (content) tag += content + '</' + name + end;
return tag;
result = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;
if (content) result += content + '</' + name + end;
return result;
}

@@ -152,3 +159,3 @@

function appendLine(line) {
function appendLine(fd, line) {
if (process.env.LOG_XUNIT) {

@@ -155,0 +162,0 @@ console.log(line);

54

package.json
{
"name": "xunit-file",
"description": "Basically the same reporter as mocha's xunit reporter, but writes the output in a file.",
"version": "0.0.6",
"author": {
"name": "Matthias Jahn",
"email": "matthias.jahn@peerigon.com"
"name": "xunit-file",
"description": "Basically the same reporter as mocha's xunit reporter, but writes the output in a file.",
"version": "0.0.7",
"author": {
"name": "Matthias Jahn",
"email": "matthias.jahn@peerigon.com"
},
"contributors": [
{
"name": "Matthias Jahn",
"email": "matthias.jahn@peerigon.com"
},
"contributors": [
{ "name": "Matthias Jahn", "email": "matthias.jahn@peerigon.com" },
{ "name": "Paul Torka", "email": "paul.torka@yahoo.de" },
{ "name": "Peter Janes", "email": "peter.janes@ek3.com" }
],
"keywords" : ["mocha", "xunit", "file", "reporter"],
"main" : "lib/xunit-file.js",
"repository" : "git://github.com/peerigon/xunit-file.git",
"license": "MIT"
{
"name": "Paul Torka",
"email": "paul.torka@yahoo.de"
},
{
"name": "Peter Janes",
"email": "peter.janes@ek3.com"
}
],
"keywords": [
"mocha",
"xunit",
"file",
"reporter"
],
"main": "lib/xunit-file.js",
"repository": "git://github.com/peerigon/xunit-file.git",
"license": "MIT",
"dependencies": {
"mkdirp": "^0.5.1"
},
"devDependencies": {
"mocha": "^2.2.5"
},
"scripts": {
"test": "rm -rf _tmp && mocha test/*.spec.js"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc