Exploring JavaScript Testing
With chapters selected by Elyse Kolker Gordon
  • September 2019
  • ISBN 9781617297670
  • 125 pages
Reliable, bug-free apps make for great experiences, and great experiences make for happy users. To write awesome JavaScript apps with confidence, you need sharp testing and debugging skills, along with a suite of testing tools you can rely on. As an added benefit, good testing discipline makes it easy to onboard new devs and work seamlessly on code with multiple developers.

About the book

Exploring JavaScript Testing is a collection of chapters from four excellent Manning books chosen by industry leader Elyse Kolker Gordon. In it, you’ll discover guidelines for applying unit testing fundamentals to JavaScript components, and you’ll gain firsthand experience testing browsers. You’ll also explore several strategies for creating and implementing unit tests and end-to-end tests.

After you’ve stepped through the basics, you’ll try out what you’ve learned with a multi-component React application. To wrap up, you’ll delve into testing isomorphic apps that can run on the server, in the browser, or both, and take a look at troubleshooting and debugging. When you’re finished, you’ll have a firm grasp on basic testing principles, techniques, and tools that make for reliable, user-friendly apps and happy users!
Table of Contents detailed table of contents

Testing Your Application

Testing JavaScript components

8.1 JavaScript testing crash course

8.1.1 Logical units in isolation

8.1.2 Using the Test Anything Protocol (TAP)

8.1.3 Putting together our first unit test

8.1.4 Tape in the browser

8.1.5 Arrange, Act, Assert

8.1.6 Unit testing

8.1.7 Convenience over convention

8.1.8 Case study: unit testing an event emitter

8.1.9 Testing the event emitter

8.1.10 Testing for the .on method

8.1.11 Mocks, spies, and proxies

8.1.12 Mocking

8.1.13 Introducing Sinon.js

8.1.14 Spying on function calls

8.1.15 Proxying require calls

8.2 Testing in the browser

8.2.1 Faking XHR and server communication

8.2.2 Case study: testing DOM interaction

8.3 Case study: unit testing the MVC shopping list

8.3.1 Testing the view router

8.3.2 Testing validation on a view model

8.4 Automating Tape tests

8.4.1 Automating Tape tests for the browser

8.4.2 Continuous testing

8.5 Integration, visual, and performance testing

8.5.1 Integration testing

8.5.2 Visual testing

8.5.3 Performance testing


Testing your application

10.1 Testing tools and setting up the chapter example

10.1.1 Testing tools

10.2 Unit testing

10.2.1 Anatomy of unit tests

10.2.2 Testing pipes

10.2.3 Testing services, stubs, and mocking HTTP requests

10.2.4 Testing components and using testing modules

10.2.5 Testing directives

10.3 e2e testing

10.4 Additional testing strategies

10.4.1 How much testing is enough?

10.4.2 When do I write tests?

10.4.3 What do I write, e2e or unit tests?

10.4.4 What if I don’t have time to write tests?

10.4.5 What about other types of testing?


Testing React Components

Testing React components

9.1 Types of testing

9.1.1 Why test?

9.2 Testing React components with Jest, Enzyme, and React-test-renderer

9.3 Writing your first tests

9.3.1 Getting started with Jest

9.3.2 Testing a stateless functional component

9.3.3 Testing the CreatePost component without Enzyme

9.3.4 Test coverage


Testing and Debugging

Testing and debugging

9.1 Testing: React components

9.1.1 Using Enzyme to test components

9.1.2 Testing user actions

9.1.3 Testing nested components

9.2 Testing: thinking isomorphically

9.2.1 Testing React components on the server

9.2.2 Testing all the things

9.3 Using debugging tools

9.3.1 React Chrome Extension

9.3.2 Redux Chrome Extension


What's inside

  • “Testing JavaScript Components” from JavaScript Application Design by Nicolas G. Bevacqua
  • “Testing Your Application” from Angular in Action by Jeremy Wilken
  • “Testing React Components” from React in Action by Mark Tielens Thomas
  • “Testing and Debugging” from Isomorphic Web Applications by Elyse Kolker Gordon

About the author

Elyse Kolker Gordon runs the growth engineering team at Strava. Previously, she was director of web engineering at Vevo, where she regularly solved challenges with isomorphic apps. She is the author of Manning’s Isomorphic Web Applications.

placing your order...

Don't refresh or navigate away from the page.
eBook $0.00 PDF only
Exploring JavaScript Testing (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.

FREE domestic shipping on three or more pBooks