3 ms·
I typically write tests and code in a way that I test the functional core of the code without testing the imperative shell part of it (at least for the unit tes
by u801e 4y ago
I typically write tests and code in a way that I test the functional core of the code without testing the imperative shell part of it (at least for the unit tests). But we also test our code by provisioning a local VM that not only deploys the code as it would be deployed on a production instance; it also installs and configures dependencies for the code.
For example, installing a DB store and populating it with test data. Our integration/functional tests will then run queries against the code and check whether the DB store was updated as expected, we got the appropriate API response from the call to it, and whether we get expected output from the logs. This way, we're not using mocks that may not be updated depending on the state of the production environment. We're using the same code that we use to deploy services in production, but just putting anything on the same VM rather than having them on different machines accessible through a separate endpoint.
- japanman425 4y agoSo e2e tests then?