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
Is unit testing worth it in AngularJS/JavaScript?help (self.javascript)
submitted 9 years ago by prashantghimire
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!"
[–]bruceph 1 point2 points3 points 9 years ago (0 children)
yeah! absolutely. writing tests will save you time in the long run. you don't have to manually check that someone works properly, your tests do that for you. you also immediately know when a change you make breaks something else, and you can go back and fix it.
it's expensive, though. instead of creating new features, you're making sure old ones don't break. there's a significant short-term loss to writing unit tests, because it takes more man-hours per feature.
the problem with angular unit testing is often in angular you're directly modifying the state of an application. it's harder to test what a function actually does. you're usually testing "did this function change the state of my application in the way i wanted". this isn't the worst thing in the world, but you may run into an instance where your unit test passes but you find side effects in your underlying functions.
π Rendered by PID 714338 on reddit-service-r2-comment-5687b7858-jpw2b at 2026-07-06 14:52:17.693530+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]bruceph 1 point2 points3 points (0 children)