Skip to content

Commit

Permalink
exclude hidden "tests" from test result
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicmh committed Apr 12, 2024
1 parent a26c5ea commit cacdfc5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/parsers/dart-json/dart-json-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class DartJsonParser implements TestParser {
const group = suite.groups[evt.test.groupIDs[evt.test.groupIDs.length - 1]]
group.tests.push(test)
tests[evt.test.id] = test
} else if (isTestDoneEvent(evt) && !evt.hidden && tests[evt.testID]) {
} else if (isTestDoneEvent(evt) && tests[evt.testID]) {
tests[evt.testID].testDone = evt
} else if (isErrorEvent(evt) && tests[evt.testID]) {
tests[evt.testID].error = evt
Expand Down Expand Up @@ -152,14 +152,16 @@ export class DartJsonParser implements TestParser {

return groups.map(group => {
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)
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)
})
const tests = group.tests
.filter(tc => !tc.testDone?.hidden)
.map(tc => {
const error = this.getError(suite, tc)
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)
})
}
Expand Down

0 comments on commit cacdfc5

Please sign in to comment.