mm
Kevin Ndung'u Gathuku

Kevin is a Full Stack Web Developer specializing in Python, JavaScript and React. He occasionally blogs about his experiences. Find him online under the username @kevgathuku.

Posts by: Kevin Ndung'u Gathuku

Testing Python Applications with Pytest

Introduction Testing applications has become a standard skill set required for any competent developer today. The Python community embraces testing, and even the Python standard library has good inbuilt tools to support testing. In the larger Python ecosystem, there are a lot of testing tools. Pytest stands out among them due to its ease of use and its ability to handle increasingly complex testing needs. This tutorial will demonstrate how…

Building and Testing Web Applications with Elm

Introduction Elm is a functional programming language meant for building reliable web applications. It compiles to JavaScript and is well-known for its helpful compiler that promises no runtime errors. JavaScript is the de-facto language for building web applications. Today, we are building most of our web application logic in the frontend with JavaScript, and using the server mostly to serve up JSON. While it is simple to get started with…

Building and Testing an API Wrapper in Python

Introduction Most websites we use provide an HTTP API to enable developers to access their data from their own applications. For developers utilizing the API, this usually involves making some HTTP requests to the service, and using the responses in their applications. However, this may get tedious since you have to write HTTP requests for each API endpoint you intend to use. Furthermore, when a part of the API changes,…

Mocking External HTTP Requests in Node Tests with Nock

Introduction Testing code that depends on external services and APIs, e.g. the GitHub API, has a variety of challenges. Writing tests that make real HTTP requests to these services may be error-prone due to issues such as network connectivity, API changes, rate limiting and so on. Nock allows us to avoid these challenges by intercepting external HTTP requests and enabling us to return custom responses, making unit testing easier. By…