But, we're not done yet! We can definitely improve our testing workflow even further. At the moment, to run our E2E test we have to ensure the following:
- An Elasticsearch instance is running
- We use dotenv-cli to load our test environment and then run our API server
While we could simply note down these instructions in a README.md file, it'll provide a better developer experience if we provide a single command to run, which will automatically load up Elasticsearch, set the right environment, run our API server, run our tests, and tear everything down once it's done.
This seems too much logic to fit into one line of npm script; instead, we can write a shell script, which allows us to specify this logic ...