This is a bad example -- the unit test is just a recapitulation of the implementation! I hope the real tests aren't like this, in which case a real example would be a lot more convincing.
I think that more important point of the post is that it is possible to test javascript graphics on the command line. That's something that's typically considered fairly difficult.