Socket
Socket
Sign inDemoInstall

jest-junit

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-junit - npm Package Compare versions

Comparing version 13.1.0 to 13.2.0

2

constants/index.js

@@ -15,2 +15,3 @@ 'use strict';

JEST_JUNIT_ADD_FILE_ATTRIBUTE: 'addFileAttribute',
JEST_JUNIT_FILE_PATH_PREFIX: 'filePathPrefix',
JEST_JUNIT_INCLUDE_CONSOLE_OUTPUT: 'includeConsoleOutput',

@@ -35,2 +36,3 @@ JEST_JUNIT_INCLUDE_SHORT_CONSOLE_OUTPUT: 'includeShortConsoleOutput',

addFileAttribute: 'false',
filePathPrefix: '',
includeConsoleOutput: 'false',

@@ -37,0 +39,0 @@ includeShortConsoleOutput: 'false',

4

package.json
{
"name": "jest-junit",
"version": "13.1.0",
"version": "13.2.0",
"description": "A jest reporter that generates junit xml files",

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

"jest": "^27.2.3",
"libxmljs": "^0.19.7",
"libxmljs2": "^0.29.0",
"slash": "^3.0.0"
}
}

@@ -66,3 +66,3 @@ [![Actions Status](https://github.com/jest-community/jest-junit/actions/workflows/nodejs.yml/badge.svg?branch=master)](https://github.com/jest-community/jest-junit/actions)

| `JEST_JUNIT_OUTPUT_FILE` | `outputFile` | Fullpath for the output. If defined, `outputDirectory` and `outputName` will be overridden | `undefined` | N/A
| `JEST_JUNIT_UNIQUE_OUTPUT_NAME` | `uniqueOutputName` | Create unique file name for the output `junit-${uuid}.xml`, overrides `outputName` | `false` | N/A
| `JEST_JUNIT_UNIQUE_OUTPUT_NAME` | `uniqueOutputName` | Create unique file name for the output leveraging the `outputName` as a prefix if given `${outputName}-${uuid}.xml` or a default of `junit-${uuid}.xml` if `outputName` is not specified, overrides `outputName` | `false` | N/A
| `JEST_JUNIT_SUITE_NAME` | `suiteNameTemplate` | Template string for `name` attribute of the `<testsuite>`. | `"{title}"` | `{title}`, `{filepath}`, `{filename}`, `{displayName}`

@@ -73,2 +73,3 @@ | `JEST_JUNIT_CLASSNAME` | `classNameTemplate` | Template string for the `classname` attribute of `<testcase>`. | `"{classname} {title}"` | `{classname}`, `{title}`, `{suitename}`, `{filepath}`, `{filename}`, `{displayName}`

| `JEST_JUNIT_ADD_FILE_ATTRIBUTE` | `addFileAttribute` | Add file attribute to the output (validated on CIRCLE CI and GitLab CI). Must be a string. | `"false"` | N/A
| `JEST_JUNIT_FILE_PATH_PREFIX` | `filePathPrefix` | Prefix to add to the test suite file path. The value will be prefixed using `path.join`. Useful in case of monorepo | `""` | N/A
| `JEST_JUNIT_INCLUDE_CONSOLE_OUTPUT` | `includeConsoleOutput` | Adds console output to any testSuite that generates stdout during a test run. | `false` | N/A

@@ -75,0 +76,0 @@ | `JEST_JUNIT_INCLUDE_SHORT_CONSOLE_OUTPUT` | `includeShortConsoleOutput` | Adds short console output (only message value) to any testSuite that generates stdout during a test run. | `false` | N/A

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

// Build variables for suite name
const filepath = path.relative(appDirectory, suite.testFilePath);
const filepath = path.join(suiteOptions.filePathPrefix, path.relative(appDirectory, suite.testFilePath));
const filename = path.basename(filepath);

@@ -105,0 +105,0 @@ const suiteTitle = suite.testResults[0].ancestorTitles[0];

@@ -52,4 +52,5 @@ 'use strict';

function getUniqueOutputName() {
return `junit-${uuid()}.xml`
function getUniqueOutputName(outputName) {
const outputPrefix = outputName ? outputName : 'junit'
return `${outputPrefix}-${uuid()}.xml`
}

@@ -56,0 +57,0 @@

@@ -9,3 +9,3 @@ const path = require('path');

// 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) : options.outputName
output = getOptions.replaceRootDirInOutput(jestRootDir, options.outputDirectory);

@@ -15,5 +15,5 @@ const finalOutput = path.join(output, outputName);

}
const finalOutput = getOptions.replaceRootDirInOutput(jestRootDir, output);
return finalOutput;
};
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