Book description
Test your JavaScript applications efficiently using Jasmine and React.js
In Detail
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.
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
Table of contents
-
Jasmine JavaScript Testing Second Edition
- Table of Contents
- Jasmine JavaScript Testing Second Edition
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. Getting Started with Jasmine
-
2. Your First Spec
- The Investment Tracker application
- Jasmine basics and thinking in BDD
- Setup and teardown
-
Nested describes
- Setup and teardown
- Coding a spec with shared behavior
-
Understanding matchers
- Custom matchers
-
Built-in matchers
- The toEqual built-in matcher
- The toBe built-in matcher
- The toBeTruthy and toBeFalsy matchers
- The toBeUndefined, toBeNull, and toBeNaN built-in matchers
- The toBeDefined built-in matcher
- The toContain built-in matcher
- The toMatch built-in matcher
- The toBeLessThan and toBeGreaterThan built-in matchers
- The toBeCloseTo built-in matcher
- The toThrow built-in matcher
- Summary
- 3. Testing Frontend Code
- 4. Asynchronous Testing – AJAX
- 5. Jasmine Spies
- 6. Light Speed Unit Testing
- 7. Testing React Applications
- 8. Build Automation
- Index
Product information
- Title: Jasmine JavaScript Testing - Second Edition
- Author(s):
- Release date: April 2015
- Publisher(s): Packt Publishing
- ISBN: 9781785282041
You might also like
book
JavaScript Testing with Jasmine
Get a concise introduction to Jasmine, the popular behavior-driven testing framework for JavaScript. This practical guide …
book
Testing JavaScript Applications
Automated testing will help you write high-quality software in less time, with more confidence, fewer bugs, …
book
Angular Development with TypeScript, Second Edition
Angular Development with TypeScript, Second Edition is an intermediate-level tutorial that introduces Angular and TypeScript to …
book
Advanced JavaScript
Gain a deeper understanding of JavaScript and apply it to build small applications in backend, frontend, …