jest-teamcity
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -14,5 +14,6 @@ [ | ||
{ "ancestorTitles": ["path2", "to", "test4"], "title": "title4", "status": "failed", "duration": 123 }, | ||
{ "ancestorTitles": ["path2", "to", "test5"], "title": "title5", "status": "failed", "failureMessages": ["Unexpected exception\n at path/to/file1.js:1\n at path/to/file2.js:2"], "duration": 123 } | ||
{ "ancestorTitles": ["path2", "to", "test5"], "title": "title5", "status": "failed", "failureMessages": ["Unexpected exception\n at path/to/file1.js:1\n at path/to/file2.js:2"], "duration": 123 }, | ||
{ "ancestorTitles": ["path2", "to", "constructor"], "title": "title6", "status": "passed", "duration": 123 } | ||
] | ||
} | ||
] |
@@ -40,2 +40,6 @@ "use strict"; | ||
["##teamcity[testSuiteFinished name='test5' flowId='12345']"], | ||
["##teamcity[testSuiteStarted name='constructor' flowId='12345']"], | ||
["##teamcity[testStarted name='title6' flowId='12345']"], | ||
["##teamcity[testFinished name='title6' duration='123' flowId='12345']"], | ||
["##teamcity[testSuiteFinished name='constructor' flowId='12345']"], | ||
["##teamcity[testSuiteFinished name='to' flowId='12345']"], | ||
@@ -42,0 +46,0 @@ ["##teamcity[testSuiteFinished name='path2' flowId='12345']"], |
@@ -35,2 +35,6 @@ const consoleOutput = [ | ||
["##teamcity[testSuiteFinished name='test5' flowId='12345']"], | ||
["##teamcity[testSuiteStarted name='constructor' flowId='12345']"], | ||
["##teamcity[testStarted name='title6' flowId='12345']"], | ||
["##teamcity[testFinished name='title6' duration='123' flowId='12345']"], | ||
["##teamcity[testSuiteFinished name='constructor' flowId='12345']"], | ||
["##teamcity[testSuiteFinished name='to' flowId='12345']"], | ||
@@ -37,0 +41,0 @@ ["##teamcity[testSuiteFinished name='path2' flowId='12345']"], |
"use strict"; | ||
const _ = require("lodash"); | ||
const path = require("path"); | ||
@@ -108,11 +107,20 @@ | ||
testFile.testResults.forEach(test => { | ||
const path = [filename].concat(test.ancestorTitles).concat("_tests_"); | ||
if (!_.has(suites, path)) { | ||
_.set(suites, path, []); | ||
const path = [filename].concat(test.ancestorTitles); | ||
// find current suite, creating each level if necessary | ||
let currentSuite = suites; | ||
for (const p of path) { | ||
if (!Object.prototype.hasOwnProperty.call(currentSuite, p)) { | ||
currentSuite[p] = {}; | ||
} | ||
currentSuite = currentSuite[p]; | ||
} | ||
const testsList = _.get(suites, path); | ||
testsList.push(test); | ||
// last level is array of test results | ||
if (!currentSuite["_tests_"]) { | ||
currentSuite["_tests_"] = []; | ||
} | ||
_.set(suites, path, testsList); | ||
// add the current test | ||
currentSuite["_tests_"].push(test); | ||
}); | ||
@@ -119,0 +127,0 @@ }); |
{ | ||
"name": "jest-teamcity", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "Teamcity Reporter for Jest Testing framework", | ||
"homepage": "https://github.com/itereshchenkov/jest-teamcity", | ||
"main": "lib/index.js", | ||
"dependencies": { | ||
"lodash": "^4.17.15" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"jest": "^25.1.0", | ||
"prettier": "^1.19.1" | ||
"jest": "^26.1.0", | ||
"prettier": "^2.0.5" | ||
}, | ||
@@ -14,0 +12,0 @@ "scripts": { |
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
20852
0
371
- Removedlodash@^4.17.15
- Removedlodash@4.17.21(transitive)