Video thumbnail for Create a NodeJS API with Koa and TypeScript - #12 - Bringing It All Together - Part 2

Create a NodeJS API with Koa and TypeScript - #12 - Bringing It All Together - Part 2

Feb 14, 2023
We can be confident we have a valid piece of data if we haven't already returned an error to the API consumer by this point. What we need to do next is to use our redisStorage object to persist off the submitted data to our Redis instance, and then get the full list of games back to return as part of our response. The caveat is that we want this whole process to work without Redis when in the test environment. In other words, we do not want to have to spin up a Redis instance just to run our unit tests. This means we must mock our storage implementation during testing.
#Programming #Software #Computer & Video Games