Testing JavaScript with Jasmine

1,840 views
1,761 views

Published on

A set of slides about testing your JavaScript with Jasmine

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,840
On SlideShare
0
From Embeds
0
Number of Embeds
308
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Testing JavaScript with Jasmine

  1. 1. Testing JavaScript with
  2. 2. Why should I bother testing JS?It must be treated like any other languageIts usage is evolving and is at the forefront of HTML 5amongst other technologies like Googles V8 and node.js3 Ss Sound Sustainable Speed
  3. 3. Brief OverviewJasmine is an open source project by the folks at PivotalLabsFramework agnosticWorks standalone with any type of projectBehavior Driven Approach inspired by RSpec
  4. 4. BDDWrite tests that match the feature desired by thebusiness. The code is then a reflection of exactly whatthe business wants.Business perspective: "When a user lands on the homepage and selects this option then they should see this"Developers perspective: "When the page renders, thenthis method is called with these arguments"
  5. 5. Getting StartedDownloads section: http://pivotal.github.com/jasmine/Walk through set up standalone mode Ruby gem Maven plugin Compatible with node.js
  6. 6. MatchersThese are what makes Jasmine so powerful and easy touseThe framework is extensible to write your own, but theones that come out of the box are actually awesome
  7. 7. SpiesA spy is simply a way to write an expectation andassertion that a method is called called with certain arguments returns a "stubbed" value
  8. 8. jquery-jasmineSimple 1 file "plugin"Comes with a bunch of addnl matchersAbility to load DOM "fixtures"

×