Example of how to unit test client-side JavaScript without a browser