We implemented auto-shutdown mechanism on Azure Function which can help us shutdown idle VMs automatically. In order to gain cloud information, this function use a lot of third-party packages such like @azure/arm-compute, @azure/keyvault-secrets.
Now our team want to write unit test to make new member can easily pick up this project. The problem is most of the codes are just invoke function of above packages (e.g. Check if VM exists, Download data from Vault...etc). If we want write unit test, should mock most of codes. Is this situation still need to write unit test or just write integration test instead? Thanks!
Aucun commentaire:
Enregistrer un commentaire