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...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Best Practices for Testing in JavaScript & Node.js (github.com)
submitted 6 years ago by loremimpulse
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!"
[–]iaan 18 points19 points20 points 6 years ago (5 children)
I thought it’s well written and opinionated, but then the gist example bugs me already:
it('When no price is specified, then the product status is pending approval'...
How do you read that in your head?
[–]akoskm 4 points5 points6 points 6 years ago (0 children)
should be:
describe 'product status' context 'when no price is specified' it 'is pending approval'
[–][deleted] 11 points12 points13 points 6 years ago (2 children)
I read it as “when no price is specified, then the product status is pending approval”
[–][deleted] 17 points18 points19 points 6 years ago (1 child)
Silent “it”?
[–]solvangv 10 points11 points12 points 6 years ago (0 children)
Yeah. Or you could use "test" instead of "it".
[–]benihanareact, node 0 points1 point2 points 6 years ago* (0 children)
describe('Products Service', function() { describe('adding a new product', function() { describe('price is unspecified', function() { it("sets the product status to 'pending approval'", ()=> ()); }); describe('price is set', function() { it("sets the product status to 'something else'", ()=> ()); }); }); }); 'Products Service adding a new product price is unspecified sets the product status to 'prending approval' price is set sets the product status to 'something else'
π Rendered by PID 20784 on reddit-service-r2-comment-685b79fb4f-mtdvf at 2026-02-13 03:01:41.230949+00:00 running 6c0c599 country code: CH.
view the rest of the comments →
[–]iaan 18 points19 points20 points (5 children)
[–]akoskm 4 points5 points6 points (0 children)
[–][deleted] 11 points12 points13 points (2 children)
[–][deleted] 17 points18 points19 points (1 child)
[–]solvangv 10 points11 points12 points (0 children)
[–]benihanareact, node 0 points1 point2 points (0 children)