Jasmine JavaScript Testing - Second Edition

Test your JavaScript applications efficiently using Jasmine and React.js
Preview in Mapt

Jasmine JavaScript Testing - Second Edition

Paulo Ragonha

Test your JavaScript applications efficiently using Jasmine and React.js
Mapt Subscription
FREE
$29.99/m after trial
eBook
$19.60
RRP $27.99
Save 29%
Print + eBook
$34.00
RRP $34.00
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$19.60
$34.00
$29.99 p/m after trial
RRP $27.99
RRP $34.00
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Jasmine JavaScript Testing - Second Edition Book Cover
Jasmine JavaScript Testing - Second Edition
$ 27.99
$ 19.60
Learning JavaScript Data Structures and Algorithms - Third Edition Book Cover
Learning JavaScript Data Structures and Algorithms - Third Edition
$ 35.99
$ 25.20
Buy 2 for $35.00
Save $28.98
Add to Cart

Book Details

ISBN 139781785282041
Paperback134 pages

Book Description

Take your testing of JavaScript applications to a new level of efficiency and reliability with the help of this book. Starting with the fundamentals of Jasmine and behavior-driven development (BDD), you will learn about tooling and automation. You will learn how to create a sustainable code base with the help of Jasmine. You will also take a look at integrated testing with React.js and Karma, and how you can speed this process up by faking AJAX requests. As you progress through the book, you will learn about the challenges of testing an application built on top of a framework and how you can prevent your application from suffering from dependency management. You will understand the concept of client-side and server-side rendering and test applications using React.js. You will also learn to automate using webpack and work with JavaScript module systems using ECMA Script 6 (ES6) modules.

By the end of this book, you will be a competent web developer with good knowledge and a strong understanding of how to efficiently use the Jasmine framework for testing purposes.

Table of Contents

Chapter 1: Getting Started with Jasmine
JavaScript – the bad parts
Jasmine and behavior-driven development
Downloading Jasmine
Summary
Chapter 2: Your First Spec
The Investment Tracker application
Jasmine basics and thinking in BDD
Setup and teardown
Nested describes
Summary
Chapter 3: Testing Frontend Code
Thinking in terms of components (Views)
The module pattern
Using HTML fixtures
Basic View coding rules
Testing Views with jQuery matchers
Summary
Chapter 4: Asynchronous Testing – AJAX
Acceptance criterion
Setting up the scenario
Writing the spec
Summary
Chapter 5: Jasmine Spies
The "bare" spy
Spying on an object's functions
Testing DOM events
Summary
Chapter 6: Light Speed Unit Testing
Jasmine stubs
Jasmine Ajax
Summary
Chapter 7: Testing React Applications
Project setup
Our first React component
The Virtual DOM
JSX
Component attributes (props)
Component events
Component state
Component life cycle
Composing components
Summary
Chapter 8: Build Automation
Module bundler – webpack
Test runner: Karma
Quick feedback loop
Optimizing for production
Static code analysis: JSHint
Continuous integration – Travis-CI
Summary

What You Will Learn

  • Understand and use the power of Jasmine to create better and more maintainable code bases
  • Drive your application development entirely by tests
  • Write modular and reusable code through the power of ECMA Script 6 (ES6) modules
  • Use asynchronous tests, stubs, and spies optimally
  • Test drive a React.js single-page application
  • Optimize your code to unleash the power of tooling and automation

Authors

Table of Contents

Chapter 1: Getting Started with Jasmine
JavaScript – the bad parts
Jasmine and behavior-driven development
Downloading Jasmine
Summary
Chapter 2: Your First Spec
The Investment Tracker application
Jasmine basics and thinking in BDD
Setup and teardown
Nested describes
Summary
Chapter 3: Testing Frontend Code
Thinking in terms of components (Views)
The module pattern
Using HTML fixtures
Basic View coding rules
Testing Views with jQuery matchers
Summary
Chapter 4: Asynchronous Testing – AJAX
Acceptance criterion
Setting up the scenario
Writing the spec
Summary
Chapter 5: Jasmine Spies
The "bare" spy
Spying on an object's functions
Testing DOM events
Summary
Chapter 6: Light Speed Unit Testing
Jasmine stubs
Jasmine Ajax
Summary
Chapter 7: Testing React Applications
Project setup
Our first React component
The Virtual DOM
JSX
Component attributes (props)
Component events
Component state
Component life cycle
Composing components
Summary
Chapter 8: Build Automation
Module bundler – webpack
Test runner: Karma
Quick feedback loop
Optimizing for production
Static code analysis: JSHint
Continuous integration – Travis-CI
Summary

Book Details

ISBN 139781785282041
Paperback134 pages
Read More

Read More Reviews

Recommended for You

JavaScript Testing Beginner's Guide  Book Cover
JavaScript Testing Beginner's Guide
$ 26.99
$ 18.90
Getting Started with Gulp – Second Edition Book Cover
Getting Started with Gulp – Second Edition
$ 23.99
$ 16.80
Learning Ionic - Second Edition Book Cover
Learning Ionic - Second Edition
$ 35.99
$ 25.20
Building Cross-Platform Desktop Applications with Electron Book Cover
Building Cross-Platform Desktop Applications with Electron
$ 35.99
$ 25.20
Object-Oriented JavaScript - Second Edition Book Cover
Object-Oriented JavaScript - Second Edition
$ 29.99
$ 21.00
Vue.js 2 Cookbook Book Cover
Vue.js 2 Cookbook
$ 35.99
$ 25.20