'Github Actions returning null values for valid test

I am developing a Flutter app using Firebase as a backend, and constructing some mock unit tests. One of my test cases passes without issue on my local machine, yet in my Github Action returns a null value when a set is expected. I am using this action in my workflow to access the Flutter SDK.

Here is the test in question:

test('Update user courses', () async {
      //Fetch a specific users courses
      List<Course> userCourses = await CourseHandler.getUserCourses('boomerFc', firestore);

      expect(userCourses.first.literature.keys.first, 'boken till prog1');

      userCourses = await CourseHandler.updateCourses(userCourses, firestore);

      //PROG1 doesnt have literature and should be empty
      assert(userCourses.first.literature.isEmpty);

      for(Course c in userCourses){
        if(c.shortCode == 'SL'){
          expect(c.literature['Canvas LMS Course Design'], {'9781118096345',
            '9781800563827',
            '9781782160656'});
        }else if (c.shortCode == 'PROTO'){
          expect(c.literature['Design av informationsteknik'], {'9144042035',
            '9789144042039'});
        }
      }
    });

Running 'flutter test' in my Actions container yields the following result:

 Expected: Set:['9781118096345', '9781800563827', '9781782160656']
50
    Actual: <null>
51
     Which: is not Iterable
52
  
53
  package:test_api           expect
54
  test/user_test.dart 76:11  main.<fn>.<fn>

What are the differences in GitHubs container environment and my own? I have upgraded all dependencies using 'flutter pub upgrade' before running the tests, but I still get the same results.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source