Get TDD

I build meaningful software by empathising with design, development and business needs. My interests are test automation, functional programming and full-stack web development using NodeJS and other tools.
Search for a command to run...

I build meaningful software by empathising with design, development and business needs. My interests are test automation, functional programming and full-stack web development using NodeJS and other tools.
No comments yet. Be the first to comment.
Get started with Test-Driven Development by building a simple Calculator API in a modern, server-side, framework - Fastify.
The beginning is a very good place to start and we begin by setting up our project. You might want to skip this if you're familiar with setting up a project with Jest and Typescript. I have opened a Github pull request that shows all the code changes...
Being able to safely refactor code is one of the greatest benefits of writing tests. The goal of refactoring is to improve code design e.g. style, design patterns, performance. Let's take an example from the previous route handler which has already b...

Marginal gains ⚙️ The 2020 Summer Olympic Games were held in Tokyo between 23 July and 8 August. The enduring motto of the Olympics is “Faster, Higher, Stronger”. From 1908 to 2003 the British cycling team won only 1 gold medal at the Olympics. This ...

This is a scenario that took some time to understand. I could see errors in the browser but everything on the server seemed to be configured correctly. The problem was, that when a request was made by the browser, the server handling the request made...

Florida and Minnesota each developed their Statewide Automated Child Welfare Information System (SACWIS). In Florida, system development started in 1990 and was estimated to take 8 years and cost $32 million. As Johnson spoke in 2002, Florida had spe...

Why a health route? I want to begin with the end in mind. When our API is deployed in a cloud environment, the automated, cloud deployment will need a way to know that our API has started correctly. That is the purpose of the GET /health route. I hav...

In a world where APIs rule the web and JavaScript is the language that reigns across all the stacks, one framework shall rise to challenge the Kingdom of Express.
Fastify, first of its name, is a low overhead (aka. fast) server-side JavaScript framework. Express is currently the most popular NodeJs framework and Fastify is compatible with Express. What makes Fastify a beauty 🌸 is that it's faster, has more features and makes testing our APIs so easy.
What we are going to build together is a simple Calculator API. When we POST an array of numbers e.g. [2, 4] our API will add them together and return 6. It's simple so we keep our attention on testing.
Test-Driven Development is a programming practice where:
This is commonly known as Red, Green and Refactor. It reminds me of traffic lights 🚥.
The plan is that I will create a blank repo and open PR's so you can see how we can evolve an API using tests.
If you would like to skip ahead, take a look at this Github repository.
See you soon.
✌️