angularjs - writing jasmine tests for Angular controller -
angularjs - writing jasmine tests for Angular controller -
upon load of controller in angular perform bunch of initialization. initialization local while others via http calls.
while writing testcases, in order check whether variables initialized should initialing controller in every test-case below:
describe('on-load',function(){ it('should initialize scope.player xyz if some-dependency abc',function(){ createcontroller(); expect( .... ); } it('should initialize scope.player mno if some-dependency def',function(){ createcontroller(); expect( .... ); } it('should initialize scope.canvas.size 900',function(){ createcontroller(); expect( .... ); } }
is right way of thinking writing jasmine tests angular controllers ?
the controller created in each it
block , think it's fine.
angularjs jasmine
Comments
Post a Comment