Testing JavaScript with Jasmine

  • 1,573 views
Uploaded on

A set of slides about testing your JavaScript with Jasmine

A set of slides about testing your JavaScript with Jasmine

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,573
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
6
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Testing JavaScript with
  • 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. 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. 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. Getting StartedDownloads section: http://pivotal.github.com/jasmine/Walk through set up standalone mode Ruby gem Maven plugin Compatible with node.js
  • 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. 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. jquery-jasmineSimple 1 file "plugin"Comes with a bunch of addnl matchersAbility to load DOM "fixtures"