Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Frontend_Testing.pdf
Search
Rob Tarr
July 25, 2014
0
88
Frontend_Testing.pdf
Rob Tarr
July 25, 2014
Tweet
Share
More Decks by Rob Tarr
See All by Rob Tarr
Blur the Lines: Write Web Apps That Feel Native
robtarr
1
95
Blur The Lines - Native Feeling Web Apps
robtarr
0
78
Blur the Lines: How to write web apps that look native.
robtarr
0
78
Responsive JavaScript
robtarr
4
940
Development Tools and Responsive JavaScript
robtarr
1
150
JavaScript App Development
robtarr
3
390
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
125
32k
The Language of Interfaces
destraynor
151
23k
The Pragmatic Product Professional
lauravandoore
25
5.8k
What's new in Ruby 2.0
geeforr
337
31k
A designer walks into a library…
pauljervisheath
200
23k
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
Web Components: a chance to create the future
zenorocha
305
41k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
244
20k
What the flash - Photography Introduction
edds
64
11k
Code Review Best Practice
trishagee
55
15k
RailsConf 2023
tenderlove
3
540
The Mythical Team-Month
searls
216
42k
Transcript
Rob Tarr - @robtarr Ryan Cromwell - @cromwellryan ! Frontend
Testing
Why should I test my JavaScript?
Why should I test my JavaScript? ‣ Stories ‣ Pain
Points
Writing Tests With
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!
Automating Tests With Grunt
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"!
Adding Tests to an Existing Codebase
Refactoring jQuery
AJAX && Promises
Coding for Better Tests
THANKS! @robtarr @cromwellryan