Testing API Calls

In this post, we’ll look at testing API calls by setting up mock responses.

Jest With Enzyme

The Enzyme package, from Airbnb, appears to solve some of the problems I ran into when using plain Jest. “Enzyme is a JavaScript Testing utility for React that makes it easier to assert, manipulate, and traverse your React Components’ output”. For example, with Enzyme, I was able to use a .click method much like RSpec […]

Testing with Jest

In my portfolio-analyzer repository, containing a Rails API back end and a JavaScript front end, all of the Rails testing is done with RSpec. With a small amount of setup, RSpec testing is as simple as navigating to a page and ‘clicking’ an element. It is incredibly readable. visit ‘http://localhost:3000’ page.first(‘#portfolioEdit’).click fill_in “Name”, :with => […]

Javascript Feature Test With RSpec

The application is a Rails API backend with a Javascript frontend, in a single GitHub repository. All the Rails testing for models and controllers is done with RSpec. For expediency, I thought I’d try RSpec to perform feature tests on the javascript frontend rather than add a second testing framework. Through a lot of trial […]

Copying JavaScript Objects

My latest portfolio project centered around the use of React and Redux. Maintaining state using these libraries involves plenty of object copying. The state provided to the app is meant to be read-only. To make a change to the state, the app presents a new version of the state to the libraries, which take care […]

The React Redux Portfolio Project

The goal of this project was to create an app using as much of what we have learned as possible. It needed to utilize React and Redux, ES6 syntax, and communicate with a Rails backend. I chose to write a stock portfolio valuation tool similar to what you’d see on Yahoo Finance, or at an […]

Rails App with a jQuery Front End

For this project, we were to take our pre-existing Rails app (written without using JSON or Ajax), and rewrite all or part of it using JSON and Ajax. My previous Rails project was Recipe Cat, a recipe catalog application. It makes extensive use of Embedded Ruby (ERB) pages and is pretty tightly coupled with the […]