Lately, my team has been looking for better ways to create and maintain mocks in our TypeScript project. In particular, we wanted an easy way to mock out modules that we built using Sinon.JS.
In my last post, I described how you can build flexible APIs with GraphQL, using a family tree API as my demonstration. The implementation of the API was fairly simple, and I was able to traverse the graph of relationships between different people in the data set. In this post, I’ll demonstrate how we can […]
Over the past year, I’ve been working with GraphQL to build APIs. GraphQL is a query language that allows for flexible endpoints for servers, giving consumers the power to control what data they are receiving.
Lately, I’ve been using Sinon.JS for mocking in my unit tests. By using mocks for dependencies inside functions, I can write unit tests that are resilient to a changing codebase. Functions with mocks can also be developed without worrying about the chain of dependencies that could affect the logic inside the functions.
Tests can benefit a project in many different ways. For example, they help ensure that the software behaves as expected. They also help document that functionality for pieces of code that other developers may have to maintain. Lately, I’ve been using state tables in my tests to improve both of these benefits. State tables allow for […]
When making software, you have to name a lot of things. There are functions, classes, numbers, data models, etc., and they all need meaningful names to ensure better communication within a team. Over the past few months, I’ve noticed a few things that make naming things hard in a software project. These difficulties may be […]
My team has been using Knex.js to build database queries for our latest project. To create increasingly complex queries, we developed a pattern to generate SQL queries using higher-order functions. I’d like to share how we leverage these higher-order functions to make our query builders modular, concise, and very easy to understand.
I recently heard the excellent talk “A Neurobiologist’s Guide to Mind Manipulation” by Casey Watts at EmberConf. Part of the talk focused on techniques for keeping a positive attitude, so no one shuts down or shies away from discussion during the project. Basically, having positive, active teammates leads to a more effective team. Here are […]
While developing web applications, I keep a close eye on performance issues, particularly in database queries. In my latest project, I’ve been using Knex.js, a SQL query builder for Node.js. I developed a method of logging the queries executed by Knex.js as well as the execution times for each query. This method can be applied […]