When building React applications you will most likely find yourself using Jest as your testing framework. Jest has some really, really cool features built in. But when you use Enzyme you can take your testing to the nest level. One really cool feature is the ability to test click events via Enzyme to ensure your …
Multi-Environment Deployments with React
If you are using Create-React-App to scaffold your react application there is built in support for changing environment variables based on the NODE_ENV values, this is done by using .env files. In short this process works by having a .env, .env.production, .env.development set of files. When you run/build your application CRA will set the NODE_ENV value …
Building AWS Infrastructure with Terraform: S3 Bucket Creation
If you are going to be working with any cloud provider it is highly suggested that you script out the creation/maintenance of your infrastructure. In the AWS word you can use the native CloudFormation solution, but honestly I find this painful and the docs very lacking. Personally, I prefer Terraform by Hashicorp. In my experience …
Continue reading Building AWS Infrastructure with Terraform: S3 Bucket Creation
Log Early, Log Often… Saved my butt today
In a prior posting (AWS Lambda:Log Early Log often, Log EVERYTHING) I wrote about the virtues and value about having really in depth logging, especially when working with cloud services. Well today this logging saved my ASS a ton of detective work. Little Background I have a background job (Lambda that is called on a schedule) …
AWS Lambda: Log early, Log often, Log EVERYTHING
In the world of building client/server applications logs are important. They are helpful when trying to see what is going on in your application. I have always held the belief that your logs need to be detailed enough to allow you to determine the WHAT and WHERE without even looking at the code. But lets …
Continue reading AWS Lambda: Log early, Log often, Log EVERYTHING
Sinon Error: Attempted to wrap undefined property ‘XYZ as function
I ran into a fun little error recently when working on a ReactJs application. In my application I was using SinonJs to setup some spies on a method, I wanted to capture the input arguments for verification. However, when I ran my test I received the following error. Attempted to wrap undefined property handlOnAccountFilter as …
Continue reading Sinon Error: Attempted to wrap undefined property ‘XYZ as function
Ensuring componentDidMount is not called in Unit Tests
If you are building a ReactJs you will often times implement componentDidMount on your components. This is very handy at runtime, but can pose an issue for unit tests. If you are building tests for your React app you are very likely using enzyme to create instances of your component. The issue is that when enzyme creates …
Continue reading Ensuring componentDidMount is not called in Unit Tests