Something that a few people have asked me about is how I go about testing of backbone DOM interactions in Jasmine, so I thought I’d just throw up this quick example for you.

It’s about as straightforward as it gets – you just affix the el to the DOM and then remove it when it’s done. In between, you put your test (!)

And voila (you might want to move the model constructor to the beforeEach function, if you are going to be manipulating that).

Share this:
  • HackerNews
  • Reddit

Comments are closed.