lundi 27 juin 2016

Testing a function within an if statement -- AngularJS/Jasmine

I have tested most of my code, but am struggling to figure out how to test this function complete

if ($rootScope.associates == null) {
      Papa.parse('HQ1_and_2_TechCenter_SAC_NSC.csv', {
        download: true,
        header: true,
        dynamicTyping: true,
        complete: function(results, file) { // CODE NOT TESTED STARTS HERE
          $rootScope.associates = results;
        }
      });
    }

I can post some of my tests if needed, but I didn't want to throw too much code at you guys. Any suggestions on how to access that function for testing would be greatly appreciated :)

Aucun commentaire:

Enregistrer un commentaire