Fixes at the end
The following are the fixes for this chapter. You can find the commit history on GitHub for each fix as follows:
- Fix—rename router: The name of the router is better if it excludes page and is lowercase. In this way, it is cleaner:
Figure 10.22: Fix—renaming router commit
- Fix—add the missing test of
services.registration.spec.js
: The test of the registration service doesn't include verification for calling/api/registrations
, which could fail to verify the behavior of the registration service because theregister()
method might even skip sending the request to the backend:
Figure 10.23: Fix—add the missing test of services.registration.spec.js commit
- Fix—error handling on frontend: Different errors returned from the backend sometimes need to show the same message to users. It is better to have an error parser, otherwise known as an error translator, in the service to parse the error before forwarding it to the caller:
Figure 10.24: Fix—error handling on frontend commit
- Fix—Jest warning...