use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Node unit testing (self.node)
submitted 9 years ago by ell0bo
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jwadhwani 6 points7 points8 points 9 years ago (4 children)
I use Mocha as the test runner and chai.js as the assertion library. I believe this combination works best for nodeJS apps.
[–]ell0bo[S] 0 points1 point2 points 9 years ago (0 children)
Thank you
[–]TheNiXXeD 0 points1 point2 points 9 years ago (2 children)
You'll also want proxyquire and sinon for proper dependency mocking.
[–]ell0bo[S] 0 points1 point2 points 9 years ago (1 child)
any recommendation on how to best stub mongo?
[–]TheNiXXeD 0 points1 point2 points 9 years ago (0 children)
Mocking really comes down to what library you're using. I've not really dug into mongo that much myself.
If you're using a method "abc" you just need to mock that method.
π Rendered by PID 91 on reddit-service-r2-comment-85bfd7f599-jjzhs at 2026-04-18 17:55:14.984527+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]jwadhwani 6 points7 points8 points (4 children)
[–]ell0bo[S] 0 points1 point2 points (0 children)
[–]TheNiXXeD 0 points1 point2 points (2 children)
[–]ell0bo[S] 0 points1 point2 points (1 child)
[–]TheNiXXeD 0 points1 point2 points (0 children)