jest-junit
Advanced tools
Comparing version 3.4.1 to 3.5.0
{ | ||
"name": "jest-junit", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"description": "A jest result processor that generates junit xml files", | ||
@@ -10,3 +10,3 @@ "main": "index.js", | ||
"engines": { | ||
"node": ">=4.0.0" | ||
"node": ">=6.0.0" | ||
}, | ||
@@ -19,3 +19,5 @@ "files": [ | ||
"scripts": { | ||
"test": "jest" | ||
"test": "jest", | ||
"pretest:ci": "npm install jest@$JEST_VERSION", | ||
"test:ci": "jest && jest --config ./integration-tests/jest.config.js" | ||
}, | ||
@@ -28,5 +30,4 @@ "dependencies": { | ||
"devDependencies": { | ||
"jest": "20.0.4", | ||
"libxmljs": "^0.18.4" | ||
} | ||
} |
@@ -22,3 +22,6 @@ 'use strict'; | ||
'_attr': { | ||
'name': options.suiteName | ||
'name': options.suiteName, | ||
'tests': 0, | ||
'failures': 0, | ||
'time': 0 | ||
} | ||
@@ -57,2 +60,5 @@ } | ||
// Add <testsuite /> properties | ||
const suiteNumTests = suite.numFailingTests + suite.numPassingTests + suite.numPendingTests; | ||
const suiteExecutionTime = (suite.perfStats.end - suite.perfStats.start) / 1000; | ||
let testSuite = { | ||
@@ -66,4 +72,4 @@ 'testsuite': [{ | ||
timestamp: (new Date(suite.perfStats.start)).toISOString().slice(0, -5), | ||
time: (suite.perfStats.end - suite.perfStats.start) / 1000, | ||
tests: suite.numFailingTests + suite.numPassingTests + suite.numPendingTests | ||
time: suiteExecutionTime, | ||
tests: suiteNumTests | ||
} | ||
@@ -73,2 +79,7 @@ }] | ||
// Update top level testsuites properties | ||
jsonResults.testsuites[0]._attr.failures += suite.numFailingTests; | ||
jsonResults.testsuites[0]._attr.tests += suiteNumTests; | ||
jsonResults.testsuites[0]._attr.time += suiteExecutionTime; | ||
// Iterate through test cases | ||
@@ -75,0 +86,0 @@ suite.testResults.forEach((tc) => { |
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
23694
1
199