on becoming a Senior Engineer

On Becoming a Senior Engineer

Recently, I was promoted to the level of senior backend engineer. As much as I felt that this was a stamp of recognition on the work that I had done, I felt like an impostor when I compared myself with what is out there. I have been writing code professionally for about 2 years and I have been working remotely at this company for 7 months (probation period included.) Senior engineers usually have 5 years and above of professional experience under their belt....

January 15, 2023 · 5 min · Orim Dominic Adah
setTimeout JavaScript

How does setTimeout Work with the JavaScript Engine?

If one wants a function to be executed just after a period of time T in JavaScript, what do they do? They dump it in a setTimeout and surely, just immediately after T has elapsed, the function will be run. Right? Can you predict what happens when the code below is run? You should try it out in a Node.js REPL or the console. const extractTime = (date) => date.toTimeString().split(" ")[0]; var start = new Date(); console....

January 4, 2023 · 3 min · Orim Dominic Adah
Callback Function JavaScript

What is a Callback Function in JavaScript

You know how you ask someone to call you back in a phone conversation? That’s what callback functions are. They are functions to be called later; after something has happened. In order to grasp this in practice, one needs to understand two things that there is a difference between a function name fn and a function call fn(), that functions can be passed into functions as arguments, the same way that numbers, strings and arrays are passed into functions as arguments The difference between a function name and a function call Let’s consider the code snippet below...

August 7, 2022 · 5 min · Orim Dominic Adah
Design JavaScript code with tests in mind

Design Javascript Code with Tests in Mind

Writing tests is important. One popular reason is that it gives one the ability to predict what happens in code with a high degree of accuracy. With tests, one can prove with a high degree of confidence that all conditions being equal, code works as it is expected to work. Another reason why tests are important is that it influences good design. If code is written in such a way that its components can be tested with minimal or no module mocks, there is a high chance that it was designed using SOLID principles....

July 30, 2022 · 6 min · Orim Dominic Adah
NestJS Integration Testing with TypeORM and MongoDB

Write Integration Tests with NestJS, TypeORM and MongoDB

NestJS projects that use TypeORM with MongoDB are rare. The recommended ODM1 to use with MongoDB is Mongoose, but the choice is not always within our control. This article is a guide for writing integration tests in a NestJS project that uses TypeORM with MongoDB. Integration tests verify that all units required to accomplish a particular goal work together as expected. For integration tests in a backend application, database calls are not mocked....

April 7, 2022 · 5 min · Orim Dominic Adah