Problem
Remember to start the backend before running this test — or it will fail! This test requires live responses. You have not broken its dependency on the real backend implementation yet. For instructions on setting up and starting the MyBiz backend, see Chapter 13, Legacy Problems.
Discussion
Chapter 13 is title “Chapter 13: Breaking Up Dependencies” and not the proper chapter referenced inside Ch 13. “Legacy Problems” is Chapter 11.
This chapter is full of errata and invalid references to other chapters.
Example 2:
Build and test — and the test passes! This example short-circuits the discovery part of characterization tests, as described in Chapter 12, Legacy Problems. It’s an important part of the process but out of the scope of this chapter.
Chapter 12 is “Dependency Maps”
Solution
Ignore what the book says for now.
Installing Vapor
Follow the official documentation instructions here - https://docs.vapor.codes/3.0/install/macos/
Running Vapor Backend
Follow instructions in Chapter 12 after the “once vapor is installed…”
- Not mentioned in book: Xcode may have two Schemas defined for the vapor backend project once it has been generated, one called “MyBiz-Package” and another called “Run”. Select Run schema and press Play to actually start the server from Xcode.
Ancillary Issue
Ch 11: Legacy Problems introduces the concept of a “backend” which is based on Vapor. It states to reference Ch 8: Networking Client in order to setup the backend code.