3 ms·
At $DAYJOB, I find it easier to write the backend code, then write automated tests, then hook it up to the front end. Only at that point could I even try to man
by tln 7y ago
At $DAYJOB, I find it easier to write the backend code, then write automated tests, then hook it up to the front end. Only at that point could I even try to manually QA the functionality, so adding tests while adding the API is just more natural.
The lesson I take away is that clearly delineated layers in the architecture gives more opportunities for natural test oriented coding, so it's worth thinking about layers in your prototypes and their early evolution.
Luckily common frameworks and patterns are usually layered already. SPA -> API is a pretty common layering, but within the SPA, you could have views -> vuex stores -> an api client layer etc. Your API could have views -> models, etc.