Conceptual overview of Jest Enzyme testing

jest and enzyme testing blog post banner nickang

I recently had the privilege of introducing frontend testing to our code base at work. With 5 engineers working on different parts of the product at any given time, it finally made sense to add automated tests. I can foresee this helping us cut down time spent on debugging and improving the overall quality of the product.

Because our frontend stack was React and Backbone, we needed a test library that can test React components. Some deliberation later, we decided to go with Jest (by Facebook and used internally at Facebook) and Enzyme (by Airbnb and also used internally at Airbnb).

Continue reading “Conceptual overview of Jest Enzyme testing”

Temptation to just build stuff

mannequin wearing santa hat looking broken
Photo by Buzz Andersen on Unsplash

I’m beginning to adopt an engineer’s mentality of wanting to build things because it’s fun and I’d probably learn a few things along the way.

For example, I’d recently wanted to build 2 Chrome extensions with very specific uses.

Continue reading “Temptation to just build stuff”

One big difference between CS and non-CS software engineers

cs vs non cs software engineers nickang blog post banner
Photo by Alexis Brown on Unsplash

From what I can tell so far, software engineers who didn’t graduate from a Computer Science (CS) degree program quite often have an inferiority complex.

Continue reading “One big difference between CS and non-CS software engineers”

Action, not information

I was struggling quite a lot today with an algorithm challenge on LeetCode called “Generate Parentheses“. It was hard enough that after trying for 2 hours, I decided it’d be for the better to look for solutions and learn from them.

But the solution I found, which was good, was not easy to understand at all! As you can imagine, I felt pretty dumb; here I was, admitting defeat and looking at the solution, and I couldn’t even understand that!

Ok, I did understand it in the end, but only after I put my self-loathing aside and focused on breaking down the recursive algorithm staring at my face. There, I suddenly recalled a great quote from Derek Sivers that I’d heard on the Tim Ferriss Show podcast:

“If [more] information was the answer, then we’d all be billionaires with perfect abs.” – Derek Sivers

Information is useless until we sit down and make an effort to make sense of it. The key to crossing the chasm is action, not information.

My New Year’s resolution for 2018

moleskine notebook on a table
The Moleskine notebook I used every step of the way in 2017

I’m not doing this for the sake of tradition or anything like that. Instead, I’d just like to make use of the pensiveness that comes for free at the end of the year to do some visualisation of what the new year is going to be like for me, my wife, and my dog.

Continue reading “My New Year’s resolution for 2018”

Success needs health

Singapore laksa from a nearby makeshift food court near work

All the success in the world means nothing if you don’t have good health to enjoy it.

Charlane (my wife) seems to be down with food poisoning tonight. It’s one of those unpredictable, common-ish illnesses that can swoop down on you without warning and render your body totally useless.

One moment we were going to enjoy a simple dinner together in between her makeup gigs, and the next moment she’s puking in the toilet 3 times in 20 minutes. Ugh. We’re biology after all.

Continue reading “Success needs health”

What to do when your bike runs out of fuel

bike motorcycle
Photo by Les Anderson

Hello, friend. If you’re here for an actual guide on what to do when your bike runs out of fuel, skip ahead to the “What to do when your bike runs out of fuel” section below. I’ll be recounting my own experience today first in the proceeding section.

Today after knocking off from work, I hopped on my Honda Shadow 400 and rode away from the office. I was ready to go home to my wife and dog after a long day at work.

Three minutes into the 30 minutes journey though, I noticed my engine getting softer… and I immediately knew that it was running out of fuel. My eyebrows grew heavy.

Continue reading “What to do when your bike runs out of fuel”