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

@omarestrella/jest-junit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@omarestrella/jest-junit - npm Package Compare versions

Comparing version 12.1.0-beta.1 to 12.1.0-beta.2

44

index.js

@@ -1,10 +0,10 @@

'use strict';
"use strict";
const xml = require('xml');
const mkdirp = require('mkdirp');
const fs = require('fs');
const path = require('path');
const xml = require("xml");
const mkdirp = require("mkdirp");
const fs = require("fs");
const path = require("path");
const buildJsonResults = require('./utils/buildJsonResults');
const getOptions = require('./utils/getOptions');
const buildJsonResults = require("./utils/buildJsonResults");
const getOptions = require("./utils/getOptions");

@@ -24,6 +24,13 @@ // Store console results from onTestResult to later

const jsonResults = buildJsonResults(report, fs.realpathSync(process.cwd()), options);
const jsonResults = buildJsonResults(
report,
fs.realpathSync(process.cwd()),
options
);
// Set output to use new outputDirectory and fallback on original output
const outputName = (options.uniqueOutputName === 'true') ? getOptions.getUniqueOutputName() : options.outputName
const outputName =
options.uniqueOutputName === "true"
? getOptions.getUniqueOutputName()
: options.outputName;
const output = path.join(options.outputDirectory, outputName);

@@ -37,3 +44,6 @@

// Write data to file
fs.writeFileSync(finalOutput, xml(jsonResults, { indent: ' ', declaration: true }));
fs.writeFileSync(
finalOutput,
xml(jsonResults, { indent: " ", declaration: true })
);

@@ -60,3 +70,3 @@ // Jest 18 compatibility

// TODO: refactor to es6 class after testResultsProcessor support is removed
function JestJUnit (globalConfig, options) {
function JestJUnit(globalConfig, options) {
// See if constructor was invoked statically

@@ -66,6 +76,10 @@ // which indicates jest-junit was invoked as a testResultsProcessor

if (globalConfig.hasOwnProperty('testResults')) {
const newConfig = JSON.stringify({
reporters: ['jest-junit']
}, null, 2);
if (globalConfig.hasOwnProperty("testResults")) {
const newConfig = JSON.stringify(
{
reporters: ["jest-junit"],
},
null,
2
);

@@ -72,0 +86,0 @@ return processor(globalConfig);

{
"name": "@omarestrella/jest-junit",
"version": "12.1.0-beta.1",
"version": "12.1.0-beta.2",
"description": "A jest reporter that generates junit xml files",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -193,3 +193,3 @@ 'use strict';

let junitProperties = require(junitSuitePropertiesFilePath)(suite);
testCase.properties = [];
let properties = [];

@@ -211,7 +211,9 @@ let testCaseProperties = {};

testCase.properties.push(testCaseProperty);
properties.push(testCaseProperty);
});
if (testCase.properties.length === 0) {
delete testCase.properties;
if (properties.length > 0) {
testCase.testcase.push({
properties
})
}

@@ -218,0 +220,0 @@ }

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