In making a change to the directive I wanted to update the unit tests.
I wrote a new test following the current pattern (using evalAsync) and even though the test was clearly going to fail (TDD :-) it passed! I deliberately broke an existing test and it too still passed.
It looks like the function passed to evalAsync is never actually executed during the tests - and since that's where the expect() call is - it never fails.
Adding a $rootScope.$apply() causes the function passed to evalAsync to pass - however that leads to more indications that this code is dead - the functions all call 'done();' - however that function is not in scope.
Is 'done()' supposed to be the method from Jasmine 2.0 ? It looks like the project is still using Jasmine 1.3.x ? (and anyways in jasmine 2.0 done is passed in as an argument to it() etc)
In making a change to the directive I wanted to update the unit tests.
I wrote a new test following the current pattern (using evalAsync) and even though the test was clearly going to fail (TDD :-) it passed! I deliberately broke an existing test and it too still passed.
It looks like the function passed to evalAsync is never actually executed during the tests - and since that's where the expect() call is - it never fails.
Adding a $rootScope.$apply() causes the function passed to evalAsync to pass - however that leads to more indications that this code is dead - the functions all call 'done();' - however that function is not in scope.
Is 'done()' supposed to be the method from Jasmine 2.0 ? It looks like the project is still using Jasmine 1.3.x ? (and anyways in jasmine 2.0 done is passed in as an argument to it() etc)