Jest tests failing on CircleCI – ENOMEM: not enough memory

Out NestJS tests are intermittently failing with “not enough memory” error being thrown. There is nothing really special about the tests except for the fact that it is growing as the project grows. It turns out a simple CLI parameter can mitigate the issue.

I’ve found the solution in CircleCI forum and the fix was to pass the parameter -w 1 which effectively runs the test in a single thread.

# From
yarn run test
# To
yarn run test -w 1

When I tried to run the test locally with the same command, the process takes a little more time to complete compared to the regular yarn run test which is probably because it uses some form of parallel processing. Running it on single thread on CircleCI doesn’t have any impact on us at all and it even speed up the build process.

That’s it!

Posted in NodeJS | Tagged | Leave a comment

TIL – Jest expect to throw error in an async call

I just wanted to test that a certain async call should throw an error and I tried it on Jest. I’m already familiar with RSpec which has similar syntax. Below is what I did. The exec method is an async … Continue reading

Posted in JavaScript | Tagged | Leave a comment

MongoDB ReplicaSet on Docker Environment

I was playing around with MongoDB ReplicaSet yesterday in a Docker environment. The purpose is to test the integration with a backend service that connects to MongoDB. It was a very frustrating process especially when done in a local environment … Continue reading

Posted in Docker, MongoDB | Tagged , | Leave a comment

Docker Compose Environment Variable and Quotes

TLDR: Do not put any double quotes or single quotes into the environment parameter in the docker-compose.yml file. Do we really need the long version of the story? Instead of this: Use this instead: Now this is odd as I … Continue reading

Posted in Docker | Tagged , , | Leave a comment

React Native + Expo + Redux – _react.default.memo is not a function

As of early June 2019 using the latest version of Expo, I’m not able to use Redux as I’m getting this error memo is not a function when trying to use connect. Spoiler, it is because Expo is using a … Continue reading

Posted in React Native | Tagged , | Leave a comment

Using Base64 encode/decode in a React Native/Expo app

I can’t believe that I can’t easily encode and decode Base64 string in React Native without pulling my hair. I’m using Expo to manage my development workflow and it even adds more confusion. Thankfully, a little trick saves me from … Continue reading

Posted in React Native | Tagged , | Leave a comment

First Metro Securities Change Password Issue

When I tried to login to First Metro Securities today, it says that my password already expired and won’t let me log in. I think I went to the classic version and tried to login too but when I changed … Continue reading

Posted in Investments | Tagged | Leave a comment

React/Expo Uses the Incorrect IP Address in Windows 10

My setup is in a Windows 10 machine with VirtualBox installed with a Host Only Network added by VirtualBox. Every time I run expo start it always picks up the VirtualBox network adapter instead of my machine’s Ethernet adapter. Without … Continue reading

Posted in React | Tagged , | Leave a comment

TypeScript – URLSearchParams iterator typing issue

In a certain React course in Udemy, I encountered an issue on React and Typescript where an iterator does not work the way it is shown in the course and this is probably because the course is not written in … Continue reading

Posted in React, TypeScript | Leave a comment

React + Redux – Component not exported or Redux not connected

Hey there, I’m a React and Redux newbie and the annoying issue I’ve encountered is when you connect a component to Redux but the actions are not injected into the component’s props. When you follow the tutorial, it seems straightforward … Continue reading

Posted in React, Web Development | Tagged | Leave a comment