Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

Why does $state change on $apply with Karma/Jasmine

$
0
0

@mikkelvp wrote:

Hi

I am trying to create unit tests for my app. Testing a controller, when calling $scope.$apply (to resolve promises), my test fails:

Error: Unexpected request: GET app/login/login.html
No more request expected
    at $httpBackend (E:/mood/www/lib/angular-mocks/angular-mocks.js:1210:9)
    at sendReq (E:/mood/www/lib/ionic/js/ionic.bundle.js:19165:9)
    at serverRequest (E:/mood/www/lib/ionic/js/ionic.bundle.js:18877:16)
    at processQueue (E:/mood/www/lib/ionic/js/ionic.bundle.js:23399:28)
    at E:/mood/www/lib/ionic/js/ionic.bundle.js:23415:27
    at Scope.$eval (E:/mood/www/lib/ionic/js/ionic.bundle.js:24678:28)
    at Scope.$digest (E:/mood/www/lib/ionic/js/ionic.bundle.js:24489:31)
    at Scope.$apply (E:/mood/www/lib/ionic/js/ionic.bundle.js:24783:24)
    at Object.<anonymous> (E:/mood/www/app/mood/moodCtrl.unit.spec.js:112:16)

The app uses Firebase and mockfirebase for testing. But it does not seem to be due to $requireAuth not resolving and switching $state to login.

Why does $state change to login? How can i figure out what triggers the $state switch?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>