Mocking a JavaScript class with Jest: mocking vs. dependency injection | Hacker News Reader