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
110
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
100
Blur The Lines - Native Feeling Web Apps
robtarr
0
87
Blur the Lines: How to write web apps that look native.
robtarr
0
86
Responsive JavaScript
robtarr
4
950
Development Tools and Responsive JavaScript
robtarr
1
160
JavaScript App Development
robtarr
3
390
Featured
See All Featured
Scaling GitHub
holman
463
140k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
How GitHub (no longer) Works
holman
315
140k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
Site-Speed That Sticks
csswizardry
11
890
Building Applications with DynamoDB
mza
96
6.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
19
1.2k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
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