What this book covers
Chapter 1, Getting Started with Jasmine, covers the motivations behind testing a JavaScript application. It presents the concept of BDD and how it helps you to write better tests. It also demonstrates how easy it is to download Jasmine and start coding your first tests.
Chapter 2, Your First Spec, helps you learn the thought process behind thinking in terms of test-driven development. You will code your very first JavaScript functionality driven by tests. You will also learn the basic functions of Jasmine and how to structure your tests. Also demonstrated, is how Jasmine matchers work and how you can create one of your own to improve your tests' code readability.
Chapter 3, Testing Frontend Code, covers some patterns in writing maintainable browser code. You will learn about thinking in terms of components and how to use the module pattern to better organize your source files. You will also be presented with the concept of HTML fixtures and how you can use it to test your JavaScript code without requiring your servers to render an HTML. You will also learn about a Jasmine plugin called jasmine-jquery and how it can help you write better tests with jQuery.
Chapter 4, Asynchronous Testing – AJAX, talks about the challenges in testing AJAX requests and how you can use Jasmine to test any asynchronous code. You will learn about Node.js and how to create a very simple HTTP server to use as a fixture to your tests.
Chapter 5, Jasmine Spies, presents the concept of test doubles and how to use spies to do behavior checking.
Chapter 6, Light Speed Unit Testing, helps you to learn about the issues with AJAX testing and how you can make your tests run faster using stubs or fakes.
Chapter 7, Testing React Applications, introduces you to React, a library to build user interfaces, and covers how you can use it to improve the concepts presented in Chapter 3, Testing Frontend Code, to create richer and more maintainable applications, of course, driven by tests.
Chapter 8, Build Automation, presents you with the power of automation. It introduces you to webpack, a bundling tool for frontend assets. You will start to think in terms of modules and their dependencies, and you will learn how to code your tests as modules. You will also learn about packing and minifying the code to production and how to automate this process. Finally, you are going to learn about running your tests from a command line and how this can be used in a continuous integration environment with Travis.ci.