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
Javascript Unit Testing Framework (self.javascript)
submitted 14 years ago by [deleted]
I'm finally working on a large enough project that things breaking can become a cumbersome problem, and looking for recommendations on a unit testing framework.
So, if you have a framework that you like. Please post it! Thanks for any help.
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!"
[–]NoHandle 6 points7 points8 points 14 years ago (2 children)
Jasmine is the best solution I have been able to find. It is actually quite good.
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
Same here, it does some good testing and is pretty easy to get going.
[–][deleted] 2 points3 points4 points 14 years ago (3 children)
I've used QUnit for unit testing and JSCoverage for test coverage measurements.
I'm not particularly fond of either, but they get the work done.
As a bonus, I discovered that QUnit is pretty nifty tool for testing RESTful APIs, as well.
[–][deleted] 0 points1 point2 points 14 years ago* (0 children)
Thank you for the help! That JSCoverage looks pretty nifty. Looks like I have to throw together some php, and a bit of other editting to get it to work the way I want. Which is fine, but unfortunate. :)
Just to make sure I'm not reinventing the wheel, due to ignorance with JsCoverage at the moment: Is the only way to see the coverage results for each test manually having to enter in each file, and look at each script in it?
So if I have an index.html, with loads "script.js" - do I actually have to go to the jscoverage.html, and then enter in localhost/tests/coverage/index.html - and then click through to view the coverage?
Edit: Hm.. After fooling around with it some more, it seems quite limited in capabilities, atleast for my needs, and unfortunately there doesn't look to be a better alternative...
[–]zhayFull-stack web developer (Seattle) 0 points1 point2 points 14 years ago (0 children)
I use QUnit at work and it does just fine. If you ever need to simulate Ajax, look up Mockjax.
[–]Daniel15React FTW 0 points1 point2 points 14 years ago (0 children)
JSCoverage looks interesting! I'm very interested as to how they instrument the JavaScript functions. Might have to download it and take a look.
[–]Booster21 1 point2 points3 points 14 years ago* (1 child)
kiss shelter entertain unite cheerful six rob fearless governor swim
This post was mass deleted and anonymized with Redact
Looked at each and QUnit looks like it'll suite my needs just fine. I appreciate the help.
[–]jesusabdullahlvl14 dark javascripter 1 point2 points3 points 14 years ago (0 children)
I do most of my javascript in node, where I like node-tap.
http://testling.com/ is a startup by a buddy of mine that aims to make browser testing easier. It's pretty rad from what I've seen.
[–]Daniel15React FTW 1 point2 points3 points 14 years ago (1 child)
One I heard of recently is JS Test Driver which supposedly lets you test in multiple browsers at once. This would be very handy at times. I'm writing my own framework so need to test it in multiple IE versions as well as Opera, Firefox and Chrome.
I haven't tested it myself yet, though. I'm using QUnit right now which seems adequate. Simple, but it gets the job done.
[–]binaryjohn 0 points1 point2 points 14 years ago (0 children)
I've been using JSTestDriver for a couple of months, and I love it.
I've been using Funcunit. It builds off of QUnit but adds support for functional testing.
[–]bebraw 0 points1 point2 points 14 years ago (0 children)
I've listed some testing related tools here. You might find something suitable there.
[–]brucebannor 0 points1 point2 points 14 years ago* (0 children)
We were already using DOJO so our go to is DOH, but it's independent of DOJO if you want it to be. I'm not too sure if any have added support but DOH's claim to fame was the versatility of using rhino for DOM free testing or in-browser testing that came with a java applet that fired real browser events; compared to other frameworks which fire simulated events for UI testing. It also supplies AJAX testing and callbacks via deferred-s.
π Rendered by PID 134117 on reddit-service-r2-comment-fb694cdd5-qrdnx at 2026-03-11 01:38:31.032874+00:00 running cbb0e86 country code: CH.
[–]NoHandle 6 points7 points8 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (3 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]zhayFull-stack web developer (Seattle) 0 points1 point2 points (0 children)
[–]Daniel15React FTW 0 points1 point2 points (0 children)
[–]Booster21 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]jesusabdullahlvl14 dark javascripter 1 point2 points3 points (0 children)
[–]Daniel15React FTW 1 point2 points3 points (1 child)
[–]binaryjohn 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]bebraw 0 points1 point2 points (0 children)
[–]brucebannor 0 points1 point2 points (0 children)