mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
parent
d1504ea554
commit
4128d36b92
4 changed files with 98 additions and 2 deletions
26
__tests__/__outputs__/dotnet-xunitv3.md
Normal file
26
__tests__/__outputs__/dotnet-xunitv3.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||

|
||||
|Report|Passed|Failed|Skipped|Time|
|
||||
|:---|---:|---:|---:|---:|
|
||||
|[fixtures/dotnet-xunitv3.trx](#user-content-r0)|1 ✅|3 ❌||267ms|
|
||||
## ❌ <a id="user-content-r0" href="#user-content-r0">fixtures/dotnet-xunitv3.trx</a>
|
||||
**4** tests were completed in **267ms** with **1** passed, **3** failed and **0** skipped.
|
||||
|Test suite|Passed|Failed|Skipped|Time|
|
||||
|:---|---:|---:|---:|---:|
|
||||
|[DotnetTests.XUnitV3Tests.FixtureTests](#user-content-r0s0)|1 ✅|1 ❌||18ms|
|
||||
|[Unclassified](#user-content-r0s1)||2 ❌||0ms|
|
||||
### ❌ <a id="user-content-r0s0" href="#user-content-r0s0">DotnetTests.XUnitV3Tests.FixtureTests</a>
|
||||
```
|
||||
❌ Failing_Test
|
||||
Assert.Null() Failure: Value is not null
|
||||
Expected: null
|
||||
Actual: Fixture { }
|
||||
at DotnetTests.XUnitV3Tests.FixtureTests.Failing_Test() in /_/reports/dotnet/DotnetTests.XUnitV3Tests/FixtureTests.cs:line 25
|
||||
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
|
||||
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
|
||||
✅ Passing_Test
|
||||
```
|
||||
### ❌ <a id="user-content-r0s1" href="#user-content-r0s1">Unclassified</a>
|
||||
```
|
||||
❌ [Test Class Cleanup Failure (DotnetTests.XUnitV3Tests.FixtureTests.Failing_Test)]
|
||||
❌ [Test Class Cleanup Failure (DotnetTests.XUnitV3Tests.FixtureTests.Passing_Test)]
|
||||
```
|
||||
|
|
@ -135,6 +135,76 @@ Actual: False
|
|||
}
|
||||
`;
|
||||
|
||||
exports[`dotnet-trx tests matches dotnet-xunitv3 report snapshot 1`] = `
|
||||
TestRunResult {
|
||||
"path": "fixtures/dotnet-xunitv3.trx",
|
||||
"suites": [
|
||||
TestSuiteResult {
|
||||
"groups": [
|
||||
TestGroupResult {
|
||||
"name": null,
|
||||
"tests": [
|
||||
TestCaseResult {
|
||||
"error": {
|
||||
"details": "Assert.Null() Failure: Value is not null
|
||||
Expected: null
|
||||
Actual: Fixture { }
|
||||
at DotnetTests.XUnitV3Tests.FixtureTests.Failing_Test() in /_/reports/dotnet/DotnetTests.XUnitV3Tests/FixtureTests.cs:line 25
|
||||
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
|
||||
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)",
|
||||
"line": 25,
|
||||
"message": "Assert.Null() Failure: Value is not null
|
||||
Expected: null
|
||||
Actual: Fixture { }
|
||||
at DotnetTests.XUnitV3Tests.FixtureTests.Failing_Test() in /_/reports/dotnet/DotnetTests.XUnitV3Tests/FixtureTests.cs:line 25
|
||||
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
|
||||
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)",
|
||||
"path": "DotnetTests.XUnitV3Tests/FixtureTests.cs",
|
||||
},
|
||||
"name": "Failing_Test",
|
||||
"result": "failed",
|
||||
"time": 17.0545,
|
||||
},
|
||||
TestCaseResult {
|
||||
"error": undefined,
|
||||
"name": "Passing_Test",
|
||||
"result": "success",
|
||||
"time": 0.8786,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
"name": "DotnetTests.XUnitV3Tests.FixtureTests",
|
||||
"totalTime": undefined,
|
||||
},
|
||||
TestSuiteResult {
|
||||
"groups": [
|
||||
TestGroupResult {
|
||||
"name": null,
|
||||
"tests": [
|
||||
TestCaseResult {
|
||||
"error": undefined,
|
||||
"name": "[Test Class Cleanup Failure (DotnetTests.XUnitV3Tests.FixtureTests.Failing_Test)]",
|
||||
"result": "failed",
|
||||
"time": 0,
|
||||
},
|
||||
TestCaseResult {
|
||||
"error": undefined,
|
||||
"name": "[Test Class Cleanup Failure (DotnetTests.XUnitV3Tests.FixtureTests.Passing_Test)]",
|
||||
"result": "failed",
|
||||
"time": 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
"name": "Unclassified",
|
||||
"totalTime": undefined,
|
||||
},
|
||||
],
|
||||
"totalTime": 267,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`dotnet-trx tests matches report snapshot (only failed tests) 1`] = `
|
||||
TestRunResult {
|
||||
"path": "fixtures/dotnet-trx.trx",
|
||||
|
|
|
|||
2
dist/index.js
generated
vendored
2
dist/index.js
generated
vendored
|
|
@ -974,7 +974,7 @@ class DotnetTrxParser {
|
|||
}));
|
||||
const testClasses = {};
|
||||
for (const r of unitTestsResults) {
|
||||
const className = r.test.TestMethod[0].$.className;
|
||||
const className = r.test.TestMethod[0].$.className ?? "Unclassified";
|
||||
let tc = testClasses[className];
|
||||
if (tc === undefined) {
|
||||
tc = new TestClass(className);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export class DotnetTrxParser implements TestParser {
|
|||
|
||||
const testClasses: {[name: string]: TestClass} = {}
|
||||
for (const r of unitTestsResults) {
|
||||
const className = r.test.TestMethod[0].$.className
|
||||
const className = r.test.TestMethod[0].$.className ?? "Unclassified"
|
||||
let tc = testClasses[className]
|
||||
if (tc === undefined) {
|
||||
tc = new TestClass(className)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue