Skip to content

Commit

Permalink
DartGroupEntry.listDartTests: fail more loudly when invariant is viol…
Browse files Browse the repository at this point in the history
…ated
  • Loading branch information
bartekpacia committed Sep 12, 2023
1 parent 04b41fb commit 86b9b12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ fun DartGroupEntry.listTestsFlat(parentGroupName: String = ""): List<DartGroupEn
if (test.type == DartGroupEntry.GroupEntryType.TEST) {
if (parentGroupName.isEmpty()) {
// This case is invalid, because every test will have at least 1 named group - its filename.
throw IllegalStateException("Test $test has no named parent group")
throw IllegalStateException("Invariant violated: test $test has no named parent group")
}

tests.add(test.copy { name = "$parentGroupName ${test.name}" })
Expand Down
2 changes: 1 addition & 1 deletion packages/patrol/ios/Classes/PatrolAppServiceClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extension Patrol_DartGroupEntry {
// This case is invalid, because every test will have at least
// 1 named group - its filename.

continue // Ignore - what else can we do?
fatalError("Invariant violated: test \(test.name) has no named parent group")
}

test.name = "\(parentGroupName) \(test.name)"
Expand Down

0 comments on commit 86b9b12

Please sign in to comment.