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

Frontend_Testing.pdf

135d480b7bf92956adcf5abd04821376?s=47 Rob Tarr
July 25, 2014
54

 Frontend_Testing.pdf

135d480b7bf92956adcf5abd04821376?s=128

Rob Tarr

July 25, 2014
Tweet

Transcript

  1. Rob Tarr - @robtarr Ryan Cromwell - @cromwellryan ! Frontend

    Testing
  2. Why should I test my JavaScript?

  3. Why should I test my JavaScript? ‣ Stories ‣ Pain

    Points
  4. Writing Tests With

  5. describe "Bowling", ->! it "should score a 14", ->! frames

    = [ new Frame(3, 4), new Frame(3, 4) ]! game = new BowlingGame(frames)! expect(game.getTotalScore()).toEqual 14!
  6. Automating Tests With Grunt

  7. module.exports = (grunt) ->! grunt.config "jasmine",! src: "dist/js/app.js"! options:! specs:

    "specs/js/*Spec.js"! helpers: "specs/js/*Helper.js"! vendor: ["jquery.min.js", "specs/lib/*.js"]! ! grunt.loadNpmTasks "grunt-contrib-jasmine"!
  8. Adding Tests to an Existing Codebase

  9. Refactoring jQuery

  10. AJAX && Promises

  11. Coding for Better Tests

  12. THANKS! @robtarr @cromwellryan