Photo by Suzanne D. Williams on Unsplash

Last week we covered how to quickly set up a vanilla Jest testing directory. This time we’ll go deeper into the actual work of using Jest for some basic tests and the format of using Jest. In this article we’ll be focusing on Jest used in a vanilla Javascript environment rather than a framework. Additionally, this is a quick connect of how to structure the app, as such this will only be a “Hello World!” test.

First we’ll start with the our test file, index.test.js. We know that we are testing for initial Jest setup, so let’s describe that:

Photo by Jon Tyson on Unsplash

Testing has become a very important part of the development process. Within the world of Javascript Jest has become a very popular unit testing framework. With it also being developed by Facebook, Jest works natively with React (and can be added to many Javascript environments). Jest and many other testing frameworks are built to be very easy to read and use, or at least easy to learn and difficult to master. Here I will walk you through how to get Jest up and running quickly with or without a full application.

I am going to start this from an empty…

Photo by Lacie Slezak on Unsplash

Whether you love them or hate them, interviews are here to stay. They are a vetting process which goes both ways (take that with as much salt as you need). Particularly in software you may be asked to show your technical competence with skills that may never occur in your day to day life. Algorithms, data structures, whiteboarding, etc all could be a part of the every day at the new job. In a lot of cases they are not though. …

Photo by Michel Stockman on Unsplash

This is a follow up to a previous article of mine, explaining setting up Nested Attributes. There have been times where I haven’t wanted to just have one parent and one child table. What do we do if we want to have a grandparent, parent, and child? To answer this question, we’ll be diving into Ruby on Rails focusing on the include method, and what that means for our nested attributes.

Alright, so fast forward through some of the initial setup, in your Rails directory, we’ll set up our three tables. …

Old fashioned light bulb, with flecks of diffuse gold light on a black background.

If you have worked in Ruby then you have likely been to Ruby-Doc. It’s great, wonderful explains everything you could want to know about how that enumerable works. Of course, I had no idea what made the enumerables so special, why you would want each one under the hood? How does that enumerable work with variables which are not [a, b, c] or [1, 2, 3]?

First let’s set the scope for this post. Which enumerables get the most use and when should you use them? With those bite sized ideas, let’s get started.

.each, .map, .find/find_all, .reduce

Understanding the proper use of all…

Series of nesting dolls.

Relationships can be very messy. Ideally they they are clean and make us happy, but rarely does that actually come to pass. Especially when you have a single table that acts as a lynchpin in your data structure, Rails has a solution for you: nested attributes. This relationship is remarkably easy to implement, once you know where to put the various pieces. So let’s get to unifying our tables with nested relationships!

First, we’ll need a project with two models. In this case we’ll go ahead and use Rails to get us up and running quickly. …

With the popularity of Object Oriented Programming languages such as Python, Ruby, and Java, many people find the syntax and programmer relation to the code to be highly rewarding. With the massive surge in popularity Javascript has seen over the last decade, many people wanted to see OOP integrated into the functional language. With ES2015 the introduction of classes made its debut and the relation of classes and objects went into full swing. Popular frameworks such as React use classes extensively. However, they have begun to implement Hooks as an alternative to using classes. …

Hands clasped together forming a circle.

A Problem to Collaborate Through

Have you ever felt awkward amongst your peers at work? Not necessarily because they said something offensive or did something utterly stupid, but simply because you did not know what to say or how to connect with them. Ideally, the awkwardness fades as you have a chance to get to know the other person, but moving beyond the acquaintance phase to being friendly can be challenging. Becoming buddy buddy with everyone you work with or even being more than smiling and polite may be a lot to ask. …

With the evolutions brought to Javascript in ES6 and beyond, understanding the difference between the options being presented can be difficult to keep track of, especially when the differences remain small. For all intents and purposes using the function keyword or using a fat arrow, do the same task: create a function. However, there are some small differences which may influence when you choose one over the other, namely: implicit return, ‘this’, anonymous functions, and hoisting.

First let’s look at the difference between these two ways of writing a function:

Logan McGuire

A creator to the core, he enjoys all games (especially collaborative ones), baking bread, and software development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store