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
90
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
79
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
WebSockets: Embracing the real-time Web
robhawkes
59
7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.4k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
358
22k
Designing Experiences People Love
moore
136
23k
Building Your Own Lightsaber
phodgson
100
5.7k
Optimising Largest Contentful Paint
csswizardry
13
2.4k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Clear Off the Table
cherdarchuk
85
310k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
8
3.4k
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