Blog
Show blog posts by year
html javascript css php bash xml general coding arduino framework node testing accessibility angular regex svg cli
-
Testing Popstate Events with Jasmine
I recently implemented some browser History API functionality in a project, and part of this was using popstate events to handle application state when the user navigated with their browsers navigational buttons. The problem was when it came time to write tests to cover this functionality, because I was writing in TypeScript, which is a strictly type language, and the version of TypeScript I was…
-
Why You Should Not Use Rimraf
A little over a year ago I got into a discussion about the rimraf package . At the time I was using a mix of Mac and Windows and I was looking for a quick and easy way to remove the whole node_modules directory from an Angular project. My search led me to rimraf, which was touted as a cross-platform alternative to the traditional rm -rf written in node. Why Delete node_modules Anyway? The initial…
-
PHPUnit - Testing Core PHP Methods
A lot of my focus recently has been outside of PHP so I'm trying to spend some of my personal time working on a personal project. My recent child (code-wise, not my actual child which would go to explain why my time is so lacking the past year) is imogen which is a system built to generate images for email as the email client requests them. My Christmas reading of Clean Code and The Clean Coder game…
-
Web Accessibility in Detail
The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect. Tim Berners-Lee When Tim Berners-Lee opened the WWW to the general public in 1991 (previously it was internal to the CERN network) he had a vision that it would be of use by all, and that tenet is as true today as it was nearly 3 decades ago. Back in the 90's, we had little…
-
Speed Testing the SPL Iterators for Fetching Files
In the world of PHP some techniques never really go away, despite there being better alternatives added to the core functionality. One of these areas is file iteration, particularly recursively through directories and their contents. It's fairly typical to see some code use a recursive function to: Scan a directory Loop through the scanned list Add entry to a list Check if an entry is a…
-
Manual Vs Automated Testing
Testing is an essential part of any software development, ranging all the way from basic testing of some code to make sure it performs the task at hand with the perfect inputs, right up to the rigorous regression tests performed by software houses working on enterprise level applications. Testing usually comes down to two types: manual and automated. But what type of testing is better, and what are…
-
Testing Private Member Classes with Jasmine in Angular2 Template Tests
A little while ago I came across an issue when trying to implement template testing with Jasmine on an Angular2 project that was using private member classes. If you try this yourself, you'll get plenty of errors and warnings about various things that either can't be found, used, or can't be spied on. There's not a lot online about this, as it seems that private anything within Angular2 projects is…