dart-json: remove group name from test case names

This commit is contained in:
Michal Dorner 2021-03-15 10:48:37 +01:00
parent 40df4133f9
commit d5e42b8d57
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
6 changed files with 400 additions and 393 deletions

View file

@ -145,7 +145,11 @@ export class DartJsonParser implements TestParser {
group.tests.sort((a, b) => (a.testStart.test.line ?? 0) - (b.testStart.test.line ?? 0))
const tests = group.tests.map(tc => {
const error = this.getError(suite, tc)
return new TestCaseResult(tc.testStart.test.name, tc.result, tc.time, error)
const testName =
group.group.name !== undefined && tc.testStart.test.name.startsWith(group.group.name)
? tc.testStart.test.name.slice(group.group.name.length).trim()
: tc.testStart.test.name.trim()
return new TestCaseResult(testName, tc.result, tc.time, error)
})
return new TestGroupResult(group.group.name, tests)
})