Chapter 9. Testing Against External Systems

In this chapter, we will have a brief look at what happens when we want to test code that depends on another system. How should we approach such a task? Should we do it?

This is a difficult question that has no easy answer, so in this chapter I will show you some techniques that can help you in this subject. This way, you can evaluate whether applying any of these techniques is suitable for your specific case and, if so, whether it can really pay off.

In this chapter, we will learn the following topics:

  • Tips on how to write test doubles that are consistent with the expected collaboration between two subsystems or problem domains.
  • We will see how to test the code that accesses databases. This technique can ...

Get Learning Behavior-driven Development with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.