Migration: unconditionally check guards in assertEdge

Change-Id: I882cbbb4dc6dce50a47255bff7ff2cc684d158d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
diff --git a/pkg/nnbd_migration/test/migration_visitor_test.dart b/pkg/nnbd_migration/test/migration_visitor_test.dart
index 6633808..e7e51b5 100644
--- a/pkg/nnbd_migration/test/migration_visitor_test.dart
+++ b/pkg/nnbd_migration/test/migration_visitor_test.dart
@@ -1418,7 +1418,7 @@
 
   NullabilityEdge assertEdge(
       NullabilityNode source, NullabilityNode destination,
-      {@required bool hard, List<NullabilityNode> guards}) {
+      {@required bool hard, List<NullabilityNode> guards = const []}) {
     var edges = getEdges(source, destination);
     if (edges.length == 0) {
       fail('Expected edge $source -> $destination, found none');
@@ -1427,9 +1427,7 @@
     } else {
       var edge = edges[0];
       expect(edge.hard, hard);
-      if (guards != null) {
-        expect(edge.guards, unorderedEquals(guards));
-      }
+      expect(edge.guards, unorderedEquals(guards));
       return edge;
     }
   }