SlideShare a Scribd company logo
Testing JavaScript
       with
Why should I bother testing JS?
It must be treated like any other language

Its usage is evolving and is at the forefront of HTML 5
amongst other technologies like Google's V8 and node.js

3 S's
   Sound
   Sustainable
   Speed
Brief Overview
Jasmine is an open source project by the folks at Pivotal
Labs

Framework agnostic

Works standalone with any type of project

Behavior Driven Approach inspired by RSpec
BDD
Write tests that match the feature desired by the
business. The code is then a reflection of exactly what
the business wants.

Business perspective: "When a user lands on the home
page and selects this option then they should see this"

Developers perspective: "When the page renders, then
this method is called with these arguments"
Getting Started
Downloads section: http://pivotal.github.com/jasmine/
Walk through set up
  standalone mode
  Ruby gem
  Maven plugin
   Compatible with node.js
Matchers
These are what makes Jasmine so powerful and easy to
use

The framework is extensible to write your own, but the
ones that come out of the box are actually awesome
Spies
A spy is simply a way to write an expectation and
assertion that a method is
   called
   called with certain arguments
   returns a "stubbed" value
jquery-jasmine

Simple 1 file "plugin"

Comes with a bunch of addn'l matchers

Ability to load DOM "fixtures"

More Related Content

What's hot (20)

PDF
The MEAN Stack
Md. Ziaul Haq
 
PPTX
MEAN stack
Iryney Baran
 
PPTX
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
PDF
MEAN Stack
Krishnaprasad k
 
PPTX
MEAN Stack
Dotitude
 
PPTX
Unit testing for User Interfaces
webmull
 
PPTX
Better End-to-End Testing with Page Objects Model using Protractor
Kasun Kodagoda
 
PPTX
Integrating grunt and bower with maven
Rahul Nanwani
 
PDF
TDD a REST API With Node.js and MongoDB
Valeri Karpov
 
PDF
Tooling for the productive front end developer
Maurice De Beijer [MVP]
 
PPTX
TDD Setup With Jasmine
PeterKha2
 
PDF
Demo tests unitaires karma jasmine - strasbourg js - decembre 2016
kraeger
 
PDF
TDD with TypeScript, AngularJS, and Node.js
Jakub Jedryszek
 
PDF
Cypress - Best Practices
Brian Mann
 
PPTX
Tooling for the productive front-end developer
Maurice De Beijer [MVP]
 
PPTX
Mean PPT
Harendra Singh Bisht
 
PPTX
A walkthrough of JavaScript ES6 features
Michal Juhas
 
PPT
Testing Storm components with Groovy and Spock
Eugene Dvorkin
 
PDF
Mean Stack - An Overview
Naveen Pete
 
PPTX
Progressive Web App Testing With Cypress.io
Knoldus Inc.
 
The MEAN Stack
Md. Ziaul Haq
 
MEAN stack
Iryney Baran
 
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
MEAN Stack
Krishnaprasad k
 
MEAN Stack
Dotitude
 
Unit testing for User Interfaces
webmull
 
Better End-to-End Testing with Page Objects Model using Protractor
Kasun Kodagoda
 
Integrating grunt and bower with maven
Rahul Nanwani
 
TDD a REST API With Node.js and MongoDB
Valeri Karpov
 
Tooling for the productive front end developer
Maurice De Beijer [MVP]
 
TDD Setup With Jasmine
PeterKha2
 
Demo tests unitaires karma jasmine - strasbourg js - decembre 2016
kraeger
 
TDD with TypeScript, AngularJS, and Node.js
Jakub Jedryszek
 
Cypress - Best Practices
Brian Mann
 
Tooling for the productive front-end developer
Maurice De Beijer [MVP]
 
A walkthrough of JavaScript ES6 features
Michal Juhas
 
Testing Storm components with Groovy and Spock
Eugene Dvorkin
 
Mean Stack - An Overview
Naveen Pete
 
Progressive Web App Testing With Cypress.io
Knoldus Inc.
 

Viewers also liked (7)

PPTX
Zero to Testing in JavaScript
pamselle
 
PPT
Testing Javascript with Jasmine
Tim Tyrrell
 
KEY
Jasmine
Chris Powers
 
PDF
Advanced Jasmine - Front-End JavaScript Unit Testing
Lars Thorup
 
PDF
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Christopher Bartling
 
PDF
Intro to testing Javascript with jasmine
Timothy Oxley
 
PPT
Automated Testing With Jasmine, PhantomJS and Jenkins
Work at Play
 
Zero to Testing in JavaScript
pamselle
 
Testing Javascript with Jasmine
Tim Tyrrell
 
Jasmine
Chris Powers
 
Advanced Jasmine - Front-End JavaScript Unit Testing
Lars Thorup
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Christopher Bartling
 
Intro to testing Javascript with jasmine
Timothy Oxley
 
Automated Testing With Jasmine, PhantomJS and Jenkins
Work at Play
 
Ad

Similar to Testing JavaScript with Jasmine (20)

PDF
Quick tour to front end unit testing using jasmine
Gil Fink
 
PPT
Jasmine - A BDD test framework for JavaScript
Sumanth krishna
 
PPT
Jasmine presentation Selenium Camp 2013
dimakovalenko
 
PDF
Jasmine BDD for Javascript
Luis Alfredo Porras Páez
 
PDF
JavaScript TDD with Jasmine and Karma
Christopher Bartling
 
PPTX
Test driven development with Jasmine
harshit040591
 
PDF
Testing Javascript with Jasmine
André Faria Gomes
 
PDF
Quick Tour to Front-End Unit Testing Using Jasmine
Gil Fink
 
PPTX
Jasmine Testing to the Rescue!
Christopher Steele
 
PPTX
Java Script Isn\'t a Toy Anymore
Alexis Williams
 
PDF
Front end unit testing using jasmine
Gil Fink
 
PDF
3 WAYS TO TEST YOUR COLDFUSION API
Gavin Pickin
 
PDF
3 WAYS TO TEST YOUR COLDFUSION API -
Ortus Solutions, Corp
 
PDF
Javascript ui for rest services
Ioan Eugen Stan
 
PPTX
jasmine
Asanka Indrajith
 
PPTX
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
Ortus Solutions, Corp
 
PPTX
Testing JavaScript with Jasmine in Rails Applications
Hector Correa
 
PDF
How to write Testable Javascript
ColdFusionConference
 
PDF
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Gavin Pickin
 
PPTX
Jasmine
Alok Guha
 
Quick tour to front end unit testing using jasmine
Gil Fink
 
Jasmine - A BDD test framework for JavaScript
Sumanth krishna
 
Jasmine presentation Selenium Camp 2013
dimakovalenko
 
Jasmine BDD for Javascript
Luis Alfredo Porras Páez
 
JavaScript TDD with Jasmine and Karma
Christopher Bartling
 
Test driven development with Jasmine
harshit040591
 
Testing Javascript with Jasmine
André Faria Gomes
 
Quick Tour to Front-End Unit Testing Using Jasmine
Gil Fink
 
Jasmine Testing to the Rescue!
Christopher Steele
 
Java Script Isn\'t a Toy Anymore
Alexis Williams
 
Front end unit testing using jasmine
Gil Fink
 
3 WAYS TO TEST YOUR COLDFUSION API
Gavin Pickin
 
3 WAYS TO TEST YOUR COLDFUSION API -
Ortus Solutions, Corp
 
Javascript ui for rest services
Ioan Eugen Stan
 
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
Ortus Solutions, Corp
 
Testing JavaScript with Jasmine in Rails Applications
Hector Correa
 
How to write Testable Javascript
ColdFusionConference
 
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Gavin Pickin
 
Jasmine
Alok Guha
 
Ad

Recently uploaded (20)

PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
Practical Applications of AI in Local Government
OnBoard
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 

Testing JavaScript with Jasmine

  • 2. Why should I bother testing JS? It must be treated like any other language Its usage is evolving and is at the forefront of HTML 5 amongst other technologies like Google's V8 and node.js 3 S's Sound Sustainable Speed
  • 3. Brief Overview Jasmine is an open source project by the folks at Pivotal Labs Framework agnostic Works standalone with any type of project Behavior Driven Approach inspired by RSpec
  • 4. BDD Write tests that match the feature desired by the business. The code is then a reflection of exactly what the business wants. Business perspective: "When a user lands on the home page and selects this option then they should see this" Developers perspective: "When the page renders, then this method is called with these arguments"
  • 5. Getting Started Downloads section: http://pivotal.github.com/jasmine/ Walk through set up standalone mode Ruby gem Maven plugin Compatible with node.js
  • 6. Matchers These are what makes Jasmine so powerful and easy to use The framework is extensible to write your own, but the ones that come out of the box are actually awesome
  • 7. Spies A spy is simply a way to write an expectation and assertion that a method is called called with certain arguments returns a "stubbed" value
  • 8. jquery-jasmine Simple 1 file "plugin" Comes with a bunch of addn'l matchers Ability to load DOM "fixtures"