Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JavaScript TDD

E2238b15388c8601bb3476411b441a3c?s=47 Ricky Clegg
October 17, 2012

JavaScript TDD

A introduction to testing JavaScript with TDD using JS Test Driver.

E2238b15388c8601bb3476411b441a3c?s=128

Ricky Clegg

October 17, 2012
Tweet

More Decks by Ricky Clegg

Other Decks in Technology

Transcript

  1. {JavaScriptTDD} Test  Driven  Development  is  the  difference  between  good  

    developers  and  GREAT  developers me@rickyclegg.com          twi0er.com/ricky_clegg         Monday, 15 October 12
  2. The most embarrassing thing that can happen to a developer,

    is having the same bug occur twice. Monday, 15 October 12
  3. {AreYouAProfessional?} An  expert  with  specialised   knowledge  in  the  field

     which  one  is   prac;cing  professionally. A  rou=ne  which  you  do  not  waver   from. Never  causing  harm  in  the  work  they   are  doing. me@rickyclegg.com          twi0er.com/ricky_clegg         Monday, 15 October 12
  4. {WhatsUp?} me@rickyclegg.com          twi0er.com/ricky_clegg      

      Array.prototype.indexOf = function(item){ var i = this.length; while (--i) { if (item === this[i]) { return i; } } return -1; } Monday, 15 October 12
  5. {KentBeckSaid: ‘“Let there be light”. And there was light’} me@rickyclegg.com

             twi0er.com/ricky_clegg         Kent  Beck  is  credited  with  crea;ng  Test  Driven  Development  back   in  2003. Monday, 15 October 12
  6. {TestDrivenDevelopment} me@rickyclegg.com          twi0er.com/ricky_clegg      

      TDD  is  the  discipline  of  wri;ng  code  (Test  suites)  that  tests  your   produc;on  code  works. The  individual  tests  are  known  as  unit  tests. Monday, 15 October 12
  7. {TooManyChefs?} me@rickyclegg.com          twi0er.com/ricky_clegg      

      Suitest JSUnit Enhance  JS QUnit Crosscheck J3Unit   Mocha JSNUnit YUI  Test JSSpec UnitTes=ng JSpec Jasmine screw-­‐unit Test.Simple Test.More TestIt jsUnitTest JSTest JSTest.NET jsUnity FireUnit Js-­‐test-­‐driver Js-­‐test-­‐runner Sinon.js SOAtest Monday, 15 October 12
  8. {JavaScriptWeeklyTop5} me@rickyclegg.com          twi0er.com/ricky_clegg      

      Monday, 15 October 12
  9. {BrowserPanicException} Tes;ng  on  lots  of  browsers  is  a  problem  with

     most  tes;ng   frameworks,  and  there  are  not  many  ‘One  Click’  solu;ons. me@rickyclegg.com          twi0er.com/ricky_clegg         Monday, 15 October 12
  10. To be, or not to be... Monday, 15 October 12

  11. {JSTestDriver} me@rickyclegg.com          twi0er.com/ricky_clegg      

      Monday, 15 October 12
  12. {IDEPlugins} me@rickyclegg.com          twi0er.com/ricky_clegg      

      Monday, 15 October 12
  13. {DOMInsertion} me@rickyclegg.com          twi0er.com/ricky_clegg      

      /*:DOC <form name="input" action="form.asp" method="get"> Username: <input type="text" name="user"> <input type="submit" value="Submit"> </form>*/ You  can  also  insert  HTML  and  create  variables. /*:DOC password = <form> Password: <input type="password" name="pwd"> </form>*/ Monday, 15 October 12
  14. {Extendable} me@rickyclegg.com          twi0er.com/ricky_clegg      

      Adapters  for  some  of  the  biggest  tes;ng  libraries.  Allowing  you  to  keep   your  fluid  workflow  but  with  the  library  that  suits  your  product. Monday, 15 October 12
  15. Demo... Monday, 15 October 12

  16. {WhereToStart} me@rickyclegg.com          twi0er.com/ricky_clegg      

      hXp://tddjs.com Monday, 15 October 12
  17. {Links} Web  Storm Eclipse JsTestDriver Jasmine Jasmine  JSTD  Adapter Clean

     Coders JavaScript  TDD me@rickyclegg.com          twi0er.com/ricky_clegg         h0p://www.jetbrains.com/webstorm/ h0p://www.eclipse.org h0p://code.google.com/p/js-­‐test-­‐driver/ h0p://pivotal.github.com/jasmine/ h0ps://github.com/ibolmo/jasmine-­‐jstd-­‐adapter h0p://www.cleancoders.com h0p://tddjs.com Monday, 15 October 12
  18. {Questions?} me@rickyclegg.com          twi0er.com/ricky_clegg      

      Monday, 15 October 12