Open miscampbell opened 5 years ago
I usually just do integration tests with request objects built in code with each accepted parameter and assert response content/codes. I tend towards integration testing for apis cause testing the routing and handling layers together is what you're really after - I find with apis there's a lot of redundant work in unit testing handlers and routers. if you're writing complex code in your api worthy of unit testing IMO you're probably doing it wrong, it should just be an interface for your application.
Hi guys
One we could discuss at some stage am wondering what the best way forward is to Unit test a Rest API endpoints? Would like to have this discussion now as we setup v3 of the module so we can bake any changes in from the start.