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

Unit Testing Sencha Applications

Unit Testing Sencha Applications

Arthur Kay

June 05, 2012
Tweet

More Decks by Arthur Kay

Other Decks in Technology

Transcript

  1. Who am I? !   Arthur Kay !   Solutions

    Engineer at Sencha, Inc. !   Longtime ExtJS fanatic !   Web developer for 10+ years !   www.akawebdesign.com !   @arthurakay
  2. Sencha Chicago User Group !   Looking for: !  

    Speakers !   Ideas !   Giveaways !   Sponsors !   GET INVOLVED!
  3. Agenda !   Overview of Unit Testing concepts !  

    Tools !   Overview of “Prize Patrol” !   Questions
  4. Disclaimer I do not assert that this presentation: !  

    is how Sencha tests products internally !   is how Sencha would recommend you test your applications This is just a presentation of materials that have helped me.
  5. Unit Testing !   Confidence in your code. !  

    Syntax !   Unit Tests !   Integration Tests
  6. Unit Tests !   “Units” tested in isolation !  

    Setup / Teardown !   Mocks / Stubs TDD: Must write testable code!
  7. Isn’t that a lot of work? !   Yes. !

      Automation is key! !   Version control hooks !   Build process
  8. JS Testing Tools !   Syntax !   JS Lint

    / JS Hint !   Hammer.js !   Unit Tests !   Jasmine !   JsTestDriver !   Integration Tests !   Selenium !   Phantom.js
  9. Automation !   Shell scripts !   IDE plugins !

      (Or something more elegant…)
  10. Testing a Sencha MVC App !   MVC separates presentation

    from logic !   Easy to write testable “units” !   Should allow us to “drive” tests
  11. Jasmine !   Testing the “testable” units !   Little

    or no reliance on DOM !   Sencha uses Jasmine internally
  12. Phantom.js !   Lint all JS files (PhantomLint) !  

    Execute all Unit Tests (Jasmine) !   Drive Integration Tests (Casper.js)