Checking our API server is ready

Next, we need to run our tests. But, if we do it immediately after we execute yarn run serve &, it will not work:

# This won't work!
yarn run serve &
yarn run test:e2e

This is because the tests are run before our API server is ready to handle the requests. Therefore, just like we did with the Elasticsearch service, we must wait for our API server to be ready before running our tests.