Book Image

Learning Behavior-driven development with Javascript

Book Image

Learning Behavior-driven development with Javascript

Overview of this book

Table of Contents (17 chapters)
Learning Behavior-driven Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5. Testing a REST Web API

In this chapter, you will learn how to test a REST web API. As we will see, publishing a specific functionality as a REST web API is not simple and involves a lot of corner cases. Fortunately, there are a lot of tricks we can use to make our life easier.

In this chapter, you will learn the following topics:

  • How to make a very fast test suite that can run around 150 tests per second to drive a REST API

  • Why we should isolate the tests of the REST API from the tests of our business layer and how to do this efficiently

  • The main design patterns for our test suite when dealing with REST APIs