1
0
Fork 0
mirror of https://github.com/dorny/test-reporter.git synced 2026-03-22 07:52:14 +01:00

NUnit Legacy: clean up suite/group names

This commit is contained in:
Shamus Taylor 2025-03-05 11:15:25 -06:00
parent 0850bc862a
commit e89b2f3e47
No known key found for this signature in database
GPG key ID: C44FC1AA547ACE39
5 changed files with 34 additions and 34 deletions

4
dist/index.js generated vendored
View file

@ -789,7 +789,7 @@ class DotnetNunitLegacyParser {
// But ignore "Theory" suites.
const suitesWithoutTheories = suitePath.filter(suite => suite.$.type !== 'Theory');
const suiteName = suitesWithoutTheories
.slice(0, suitesWithoutTheories.length - 1)
.filter(suite => suite.$.type !== 'Assembly' && suite.$.type !== 'Project')
.map(suite => suite.$.name)
.join('.');
const groupName = suitesWithoutTheories[suitesWithoutTheories.length - 1].$.name;
@ -803,7 +803,7 @@ class DotnetNunitLegacyParser {
existingGroup = new test_results_1.TestGroupResult(groupName, []);
existingSuite.groups.push(existingGroup);
}
existingGroup.tests.push(new test_results_1.TestCaseResult(testCase.$.name, this.getTestExecutionResult(testCase), parseFloat(testCase.$.time), this.getTestCaseError(testCase)));
existingGroup.tests.push(new test_results_1.TestCaseResult(testCase.$.name.startsWith(suiteName + '.') ? testCase.$.name.substring(suiteName.length + 1) : testCase.$.name, this.getTestExecutionResult(testCase), parseFloat(testCase.$.time), this.getTestCaseError(testCase)));
}
getTestExecutionResult(test) {
if (test.$.result === 'Failed' || test.failure)