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

PPTX
React web development
ODP
Test Automation Framework using Cucumber BDD Overview - part 2
PPTX
TypeScript Jump Start
PPTX
Automated Testing with Cucumber, PhantomJS and Selenium
PDF
NodeSummit - MEAN Stack
PPTX
Introduction to mean stack
PPTX
Javascripts. pptt
React web development
Test Automation Framework using Cucumber BDD Overview - part 2
TypeScript Jump Start
Automated Testing with Cucumber, PhantomJS and Selenium
NodeSummit - MEAN Stack
Introduction to mean stack
Javascripts. pptt

What's hot (20)

PDF
The MEAN Stack
PPTX
MEAN stack
PPTX
PHP Indonesia - Nodejs Web Development
PDF
MEAN Stack
PPTX
MEAN Stack
PPTX
Unit testing for User Interfaces
PPTX
Better End-to-End Testing with Page Objects Model using Protractor
PPTX
Integrating grunt and bower with maven
PDF
TDD a REST API With Node.js and MongoDB
PDF
Tooling for the productive front end developer
PPTX
TDD Setup With Jasmine
PDF
Demo tests unitaires karma jasmine - strasbourg js - decembre 2016
PDF
TDD with TypeScript, AngularJS, and Node.js
PDF
Cypress - Best Practices
PPTX
Tooling for the productive front-end developer
PPTX
PPTX
A walkthrough of JavaScript ES6 features
PPT
Testing Storm components with Groovy and Spock
PDF
Mean Stack - An Overview
PPTX
Progressive Web App Testing With Cypress.io
The MEAN Stack
MEAN stack
PHP Indonesia - Nodejs Web Development
MEAN Stack
MEAN Stack
Unit testing for User Interfaces
Better End-to-End Testing with Page Objects Model using Protractor
Integrating grunt and bower with maven
TDD a REST API With Node.js and MongoDB
Tooling for the productive front end developer
TDD Setup With Jasmine
Demo tests unitaires karma jasmine - strasbourg js - decembre 2016
TDD with TypeScript, AngularJS, and Node.js
Cypress - Best Practices
Tooling for the productive front-end developer
A walkthrough of JavaScript ES6 features
Testing Storm components with Groovy and Spock
Mean Stack - An Overview
Progressive Web App Testing With Cypress.io
Ad

Viewers also liked (7)

PPTX
Zero to Testing in JavaScript
PPT
Testing Javascript with Jasmine
KEY
Jasmine
PDF
Advanced Jasmine - Front-End JavaScript Unit Testing
PDF
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
PDF
Intro to testing Javascript with jasmine
PPT
Automated Testing With Jasmine, PhantomJS and Jenkins
Zero to Testing in JavaScript
Testing Javascript with Jasmine
Jasmine
Advanced Jasmine - Front-End JavaScript Unit Testing
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Intro to testing Javascript with jasmine
Automated Testing With Jasmine, PhantomJS and Jenkins
Ad

Similar to Testing JavaScript with Jasmine (20)

PDF
Quick tour to front end unit testing using jasmine
PPT
Jasmine - A BDD test framework for JavaScript
PPT
Jasmine presentation Selenium Camp 2013
PDF
Jasmine BDD for Javascript
PDF
JavaScript TDD with Jasmine and Karma
PPTX
Test driven development with Jasmine
PDF
Testing Javascript with Jasmine
PDF
Quick Tour to Front-End Unit Testing Using Jasmine
PPTX
Jasmine Testing to the Rescue!
PPTX
Java Script Isn\'t a Toy Anymore
PDF
Front end unit testing using jasmine
PDF
3 WAYS TO TEST YOUR COLDFUSION API
PDF
3 WAYS TO TEST YOUR COLDFUSION API -
PDF
Javascript ui for rest services
PPTX
PPTX
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
PPTX
Testing JavaScript with Jasmine in Rails Applications
PDF
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
PDF
How to write Testable Javascript
PPTX
Jasmine
Quick tour to front end unit testing using jasmine
Jasmine - A BDD test framework for JavaScript
Jasmine presentation Selenium Camp 2013
Jasmine BDD for Javascript
JavaScript TDD with Jasmine and Karma
Test driven development with Jasmine
Testing Javascript with Jasmine
Quick Tour to Front-End Unit Testing Using Jasmine
Jasmine Testing to the Rescue!
Java Script Isn\'t a Toy Anymore
Front end unit testing using jasmine
3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API -
Javascript ui for rest services
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
Testing JavaScript with Jasmine in Rails Applications
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
How to write Testable Javascript
Jasmine

Recently uploaded (20)

PDF
CloudStack 4.21: First Look Webinar slides
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
Unlock new opportunities with location data.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Architecture types and enterprise applications.pdf
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
STKI Israel Market Study 2025 version august
PDF
August Patch Tuesday
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
CloudStack 4.21: First Look Webinar slides
Final SEM Unit 1 for mit wpu at pune .pptx
Benefits of Physical activity for teenagers.pptx
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
observCloud-Native Containerability and monitoring.pptx
Unlock new opportunities with location data.pdf
Zenith AI: Advanced Artificial Intelligence
Architecture types and enterprise applications.pdf
NewMind AI Weekly Chronicles – August ’25 Week III
O2C Customer Invoices to Receipt V15A.pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
A contest of sentiment analysis: k-nearest neighbor versus neural network
STKI Israel Market Study 2025 version august
August Patch Tuesday
Enhancing emotion recognition model for a student engagement use case through...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
sustainability-14-14877-v2.pddhzftheheeeee
A review of recent deep learning applications in wood surface defect identifi...
Assigned Numbers - 2025 - Bluetooth® Document
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor

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"