Wrapping Up

In this chapter, we covered testing controllers and Phoenix Channels as the interfaces to our Phoenix-based web application. Controller tests are used in applications that serve JSON-based API endpoints as well as server-rendered HTML endpoints. Channel tests cover the interactions over web sockets. You should now be familiar with using the most common test-helper functions provided by Phoenix, Plug, and ChannelTest. You should also understand the how and why of making sure your tests cover both return values and side effects.

In the next chapter, we’ll introduce you to property-based testing. We’ll show you tooling that will help you lock down the behavior of your code where it’s most likely to have large variation in its input.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.140.5