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

Correct test time output

This commit is contained in:
Shamus Taylor 2025-03-05 15:06:35 -06:00
parent e89b2f3e47
commit 3eeb9fc888
No known key found for this signature in database
GPG key ID: C44FC1AA547ACE39
5 changed files with 19 additions and 20 deletions

5
dist/index.js generated vendored
View file

@ -759,9 +759,8 @@ class DotnetNunitLegacyParser {
}
getTestRunResult(path, nunit) {
const suites = [];
const time = parseFloat(nunit['test-results'].$.time);
this.populateTestCasesRecursive(suites, [], nunit['test-results']['test-suite']);
return new test_results_1.TestRunResult(path, suites, time);
return new test_results_1.TestRunResult(path, suites);
}
populateTestCasesRecursive(result, suitePath, testSuites) {
if (testSuites === undefined) {
@ -803,7 +802,7 @@ class DotnetNunitLegacyParser {
existingGroup = new test_results_1.TestGroupResult(groupName, []);
existingSuite.groups.push(existingGroup);
}
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)));
existingGroup.tests.push(new test_results_1.TestCaseResult(testCase.$.name.startsWith(suiteName + '.') ? testCase.$.name.substring(suiteName.length + 1) : testCase.$.name, this.getTestExecutionResult(testCase), testCase.$.time ? parseFloat(testCase.$.time) * 1000 : 0, this.getTestCaseError(testCase)));
}
getTestExecutionResult(test) {
if (test.$.result === 'Failed' || test.failure)