jest-junit
Advanced tools
Comparing version 12.0.0 to 12.1.0
@@ -8,2 +8,3 @@ 'use strict'; | ||
JEST_JUNIT_OUTPUT_NAME: 'outputName', | ||
JEST_JUNIT_OUTPUT_FILE: 'outputFile', | ||
JEST_JUNIT_UNIQUE_OUTPUT_NAME: 'uniqueOutputName', | ||
@@ -10,0 +11,0 @@ JEST_JUNIT_CLASSNAME: 'classNameTemplate', |
11
index.js
@@ -10,2 +10,3 @@ 'use strict'; | ||
const getOptions = require('./utils/getOptions'); | ||
const getOutputPath = require('./utils/getOutputPath'); | ||
@@ -27,13 +28,9 @@ // Store console results from onTestResult to later | ||
// Set output to use new outputDirectory and fallback on original output | ||
const outputName = (options.uniqueOutputName === 'true') ? getOptions.getUniqueOutputName() : options.outputName | ||
const output = path.join(options.outputDirectory, outputName); | ||
let outputPath = getOutputPath(options, jestRootDir); | ||
const finalOutput = getOptions.replaceRootDirInOutput(jestRootDir, output); | ||
// Ensure output path exists | ||
mkdirp.sync(path.dirname(finalOutput)); | ||
mkdirp.sync(path.dirname(outputPath)); | ||
// Write data to file | ||
fs.writeFileSync(finalOutput, xml(jsonResults, { indent: ' ', declaration: true })); | ||
fs.writeFileSync(outputPath, xml(jsonResults, { indent: ' ', declaration: true })); | ||
@@ -40,0 +37,0 @@ // Jest 18 compatibility |
{ | ||
"name": "jest-junit", | ||
"version": "12.0.0", | ||
"version": "12.1.0", | ||
"description": "A jest reporter that generates junit xml files", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -62,2 +62,3 @@ [![Build Status](https://travis-ci.org/jest-community/jest-junit.svg?branch=master)](https://travis-ci.org/jest-community/jest-junit) | ||
| `JEST_JUNIT_OUTPUT_NAME` | `outputName` | File name for the output. | `"junit.xml"` | N/A | ||
| `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 | ||
@@ -64,0 +65,0 @@ | `JEST_JUNIT_SUITE_NAME` | `suiteNameTemplate` | Template string for `name` attribute of the `<testsuite>`. | `"{title}"` | `{title}`, `{filepath}`, `{filename}`, `{displayName}` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35129
9
384
249