mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
Add go-unit test
This commit is contained in:
parent
8079cf8926
commit
e0f4952e74
8 changed files with 184 additions and 32158 deletions
|
|
@ -50,7 +50,7 @@ export class GoJunitParser implements TestParser {
|
|||
private getGroups(suite: TestSuite): TestGroupResult[] {
|
||||
const groups: {describe: string; tests: TestCase[]}[] = []
|
||||
const returnEmpytGroups: TestGroupResult[] = [];
|
||||
if (suite.testcase.length === 0) return returnEmpytGroups;
|
||||
if (!suite.testcase?.length) return returnEmpytGroups;
|
||||
for (const tc of suite.testcase) {
|
||||
let grp = groups.find(g => g.describe === tc.$.classname)
|
||||
if (grp === undefined) {
|
||||
|
|
@ -83,7 +83,8 @@ export class GoJunitParser implements TestParser {
|
|||
return undefined
|
||||
}
|
||||
|
||||
const details = tc.failure[0]
|
||||
const failure = tc.failure?.[0]
|
||||
const details = (typeof failure === 'object' ? failure._ : failure) || ""
|
||||
let path
|
||||
let line
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ export interface TestCase {
|
|||
name: string
|
||||
time: string
|
||||
}
|
||||
failure?: string[]
|
||||
failure?: string[] | Failure[]
|
||||
error?: string[] | Failure[]
|
||||
skipped?: string[]
|
||||
}
|
||||
|
||||
export interface Failure {
|
||||
_: string
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue