What you can do is
expect(window.setInterval).toHaveBeenCalledWith(jasmine.any("function"),
100);
To verify some function was passed in, though you'll want another
test to verify that function does what it should.
I prefer using Jasmine.clock for testing timers, as then I'm testing
the intended results of the callback rather then the mechanics of how
the timer is set up.
> --
> You received this message because you are subscribed to the Google Groups "Jasmine" group.
> To post to this group, send email to jasmi...@googlegroups.com.
> To unsubscribe from this group, send email to jasmine-js+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jasmine-js?hl=en.
>
>
And see http://groups.google.com/group/jasmine-js/browse_thread/thread/dbdc5ad1c1514322/a20949232ace1ae6
for more details on Jasmine's Mock Clock.
--
Alex Chaffee - al...@stinky.com - http://alexch.github.com
Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch |
http://alexch.tumblr.com