- Use mockery to inject a mock the require dependency
- Use supertest to make an http request to the server
- Use mocha as test runner
I think StackOverflow was awesome when it started (and several years later still is) but over then it had failed to innovate / grow.
There has been attempts to create products like SO documentation, and SO jobs (and now SO teams) but they are not aligned with what made SO good in the first place. ¿What is the one thing SO was meat to solve in the first place?
This is was Jeff Atwood wrote when it was launched:
Stackoverflow is sort of like the anti-experts-exchange (minus the nausea-inducing sleaze and quasi-legal search engine gaming) meets wikipedia meets programming reddit. It is by programmers, for programmers, with the ultimate intent of collectively increasing the sum total of good programming knowledge in the world. No matter what programming language you use, or what operating system you call home. Better programming is our goal.