Steven Senkus

Software Developer living in ๐ŸŒž sunny, ๐ŸŒž sunny San Diego

Writing Better JavaScript Unit Tests - Scenarios

When you have a function or class method that can take many conditional paths and varying parameters, it can be tempting to write a lot of unit tests to brute force your way to complete code coverage. While this approach works, you end up repeating common test tasks like setup, initialization, and teardown. Unit test files will end up with a lot of duplication, which will make it difficult to refactor once requirements change. Read more โ†’

Using Ngrok and Node.js to share our localhost publicly

Running apps locally on our own computers is great for development, but there are many cases where software developers such as us would want to show off our work with people outside our network!ย Maybe we are working on a prototype or a feature request, maybe we do not have a server to deploy to, or maybe we are behind a restrictive corporate firewall or network. Whatever the reason, there is a way to still expose our app to the work with a public URL: ngrok! Read more โ†’

jQuery โ€“ Find event handlers for a DOM element

As a JavaScript developer, you will eventually find yourself debugging code someone else wrote.ย Unit tests only cover so much and most tests are written in an isolated environment.ย The truth in JS is when an application is running. When using third-party libraries and code you haven’t written (legacy code), it is useful to be able to figure out what’s going on before implementing a new feature or fixing buggy code. Read more โ†’

jQuery Dropdown Login Menu with One-Shot Collapse

One-shot event handlers are a very useful tool to have in your Javascript/jQuery toolbelt. In this post, we will see how to effectively add a bit of UI interactivity into our pages and applications using one-Shot event handlers to create a jQuery dropdown login menu. Program Flow: Anonymously invoke a Menu constructor function Attach event handlers for #trigger button & the hidden , setting an initial state for the drop-down form Read more โ†’