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 to write Testable Javascript
PDF
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
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 to write Testable Javascript
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Jasmine

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
“AI and Expert System Decision Support & Business Intelligence Systems”
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Unlocking AI with Model Context Protocol (MCP)
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation_ Review paper, used for researhc scholars
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

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"