0
Javascript Tests with JasmineA Primer for Front-end Devs
Chris PowersConsultant with   //obtivahttp://chrisjpowers.com@chrisjpowers
Get the Code!$ git clone git://github.com/chrisjpowers/jasmine_demo.git
Why Test Javascript?
Seems like alot of work    just for some lousyregression tests...
Test Driven Development is about much morethan just writingtest coverage!
How Does TDD Work?•Red• Green• Refactor• Repeat!
RED•Identify a business requirement• Write a test to express the requirement•Watch the test fail• Ensure it failed “correc...
GREEN•   Write code to make the test    pass•   Write as little code as possible• Focus on the requirement,    don’t solve...
REFACTOR•Improve your code quality• Remove duplication (DRY)• Modularize code• DO NOT change app behavior
REPEAT!            Feature TestUnit Test     Unit Test    Unit Test
Enforces Good Design•Modular and Namespaced• Flexible, Updatable, Reusable• Easily Testable
Focus and Process•   Driven by Business    Requirements•   Red, Green, Refactor• Know When You’re Done
“Free” Documentation•Legible Output• Expresses Object Behavior• Get Devs Up to Speed
Oh yeah...     plus you get aregression test suite
What is Jasmine?•TDD Framework• Tests Run in the Browser• No Command Line Needed• Especially Rubyist Friendly
TutorialLet’s get testing...
Upcoming SlideShare
Loading in...5
×

Javascript Tests with Jasmine for Front-end Devs

3,679

Published on

Jasmine isn't just for Rubyists - it's for anyone that wants to revolutionize their Javascript code and development workflow. I give a tutorial in getting up and running with an agile, Test Driven Development workflow using nothing but HTML and Javascript.

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

No Downloads
Views
Total Views
3,679
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
32
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "Javascript Tests with Jasmine for Front-end Devs"

    1. 1. Javascript Tests with JasmineA Primer for Front-end Devs
    2. 2. Chris PowersConsultant with //obtivahttp://chrisjpowers.com@chrisjpowers
    3. 3. Get the Code!$ git clone git://github.com/chrisjpowers/jasmine_demo.git
    4. 4. Why Test Javascript?
    5. 5. Seems like alot of work just for some lousyregression tests...
    6. 6. Test Driven Development is about much morethan just writingtest coverage!
    7. 7. How Does TDD Work?•Red• Green• Refactor• Repeat!
    8. 8. RED•Identify a business requirement• Write a test to express the requirement•Watch the test fail• Ensure it failed “correctly”
    9. 9. GREEN• Write code to make the test pass• Write as little code as possible• Focus on the requirement, don’t solve future problems
    10. 10. REFACTOR•Improve your code quality• Remove duplication (DRY)• Modularize code• DO NOT change app behavior
    11. 11. REPEAT! Feature TestUnit Test Unit Test Unit Test
    12. 12. Enforces Good Design•Modular and Namespaced• Flexible, Updatable, Reusable• Easily Testable
    13. 13. Focus and Process• Driven by Business Requirements• Red, Green, Refactor• Know When You’re Done
    14. 14. “Free” Documentation•Legible Output• Expresses Object Behavior• Get Devs Up to Speed
    15. 15. Oh yeah... plus you get aregression test suite
    16. 16. What is Jasmine?•TDD Framework• Tests Run in the Browser• No Command Line Needed• Especially Rubyist Friendly
    17. 17. TutorialLet’s get testing...
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×