Skip to content

Commit

Permalink
Don't dump the tree to console when existsAtLeastNTimes fails (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy authored Nov 22, 2024
1 parent 1969e88 commit 8ca6229
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/src/spot/snapshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -469,16 +469,11 @@ extension MultiWidgetSelectorMatcher<W extends Widget> on WidgetSnapshot<W> {
errorBuilder.writeln(candidate.element.widget.toStringDeep());
});

errorBuilder
.writeln(findCommonAncestor(discoveredElements).toStringDeep());

errorBuilder.writeln(
'Found ${discovered.length} elements matching $selector in widget tree, '
'expected at most $max',
);
final tree = findCommonAncestor(discoveredElements).toStringDeep();
timeline.addEvent(
eventType: 'Assertion Failed',
details: errorBuilder.toString(),
details: '$errorBuilder\n'
'$tree',
color: Colors.red,
screenshot: timeline.takeScreenshotSync(
annotators: [
Expand Down

0 comments on commit 8ca6229

Please sign in to comment.