Posts tagged "testing"

How to test a function that works with time

Published on
#javascript #nodejs #testing 

While building Minimal Analytics I had the need to test a function that was dependent on time.

In my case, the function returned the milliseconds until midnight.

Here is a simple way to test the function msUntilMidnight.


Read more

Test driving a HackerNews scraper with Node.js

Published on
#tdd #nodejs #testing #cleancode #refactoring #javascript 

This is a short summary of my experience while writing a simple HackerNews scraper.

As a pure exercise or kata if you want, I tried to apply Clean code, Refactoring and Testing priciples for this small npm module.

The task is simple:

Get the posts on the front page of https://news.ycombinator.com and parse them.


Read more

Validate your RSS feed

Published on
#rss #testing #CI #blogging 

Today a dear user made me aware that my RSS feed broke. There was a XML Parsing Error for cri.dev/rss.xml.

ASAP after work I checked the validity through validator.w3.org/feed/ and in fact there were some issues with it.


Read more

Always $digest after you expect

Published on
#angularjs #javascript #testing 

Angular`s digest loop is like a baby: you need to take care of it and feed it well, or it will puke all over your nice shirt. Actually, it will probably, eventually do it anyway.


Read more

Don't miss out on special content for my subscribers.


View the past editions of my newsletter