Guides, how-to's and other nonsensical ramblings from a software engineer
SinonJS is a popular testing framework for JavaScript. It allows us to easily spy, stub and mock our code. The following will be a quick how-to on stubbing JavaScript methods to return different values based on the provided arguments.
Continue Reading →AWS Cloud9 is a powerful IDE you can use to develop code within your browser. It integrates with other AWS services like Lambda so you can easily download, modify and re-upload new versions of your Lambda function code. Cloud9 also comes with a managed EC2 instance with terminal access so you have full control of your development environment. In this blog post, I will run through an example of using Cloud9 to develop a Lambda function, including steps on adding a Python external package.
Continue Reading →A common use case for AWS Lambda functions is to run them regularly on a schedule. This can be used in a wide range of scenarios, from periodically performing some web scraping to sending out regular updates using SNS. In this blog post, I’ll walk through the steps you need to take to start running your Lambda function on a schedule using only the AWS console.
Continue Reading →JPA Criteria Queries allow us to create complex queries in a object-oriented manner. In this post, I’ll provide an example where we create a query that filters an entity that has a many-to-many relationship with another entity.
Continue Reading →Timer functions like setTimeout are commonly used in JavaScript to schedule tasks to run after some delay. When writing unit tests to test this kind of functionality, it isn’t ideal to wait for real time to pass especially if the delays are hours long. Jest allows us to use “fake timers” to instantly run timers to completion, or even advance time by a specified amount.
Continue Reading →Jest is a great test framework to use for unit testing Vue.js components. However mocking Node modules can be a bit tricky. In this blog post I’ll explain a method I’ve used in the past to mock an imported Node module like axios.
Continue Reading →