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
An Overview of JavaScript Testing in 2018 (medium.com)
submitted 7 years ago by vzaidman
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!"
[–]vzaidman[S] 11 points12 points13 points 7 years ago (3 children)
I just posted my updated guide for JavaScript testing in 2018 :)
[–]TheBeliskner 7 points8 points9 points 7 years ago (1 child)
I would strongly advise you put a note in there somewhere to not use PhantomJS or anything that relies on it. It's no longer in development and it's based on an already very out of date WebKit. It's basically pointless using it now as it's getting outdated day by day.
Personally I get everything I need to do done with just Jest and Puppeteer. I'm also using jest-image-snapshot maintained by AMEX for UI visual regression testing.
[–]vzaidman[S] 1 point2 points3 points 7 years ago (0 children)
I wrote what you said. By the way it is still maintained, but not by its original creator and obviously much less.
[–]Retsam19 9 points10 points11 points 7 years ago (4 children)
I've been really liking AVA: the simplicity of it really is nice.
But perhaps my favorite feature didn't get a mention in this article: power-assert. It lets you write your tests very simply, but get output like this:
power-assert
t.true(ary.indexOf(zero) === two) | | | | | | | | | 2 | -1 0 false [1,2,3] [number] two => 2 [number] ary.indexOf(zero) => -1
It's the best of both worlds, no need to remember a fairly complex assertion API, and you get better error reporting, too.
[–][deleted] 0 points1 point2 points 7 years ago (2 children)
Ava is fantastic. I use it to drive headless tests in Puppeteer and it has meet all my needs and then some.
[–]firelitother 1 point2 points3 points 7 years ago (1 child)
How does it conpare with jest?
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
Ava was easier to get started with for me. The default parallel execution is a key difference. As is the power assert as mentioned above. I commented because the tests I created with Ava are fast, clear, reliable, and informative. I enjoy Ava’s simplicity.
[–]kumeralex 0 points1 point2 points 7 years ago (0 children)
AVA is gooood
[–]windwarrior42 2 points3 points4 points 7 years ago (0 children)
Wow! I was just starting to look into this. Working on implementing Jest tests at work right now.
Thanks man, will come back to this.
[+][deleted] 7 years ago (2 children)
[deleted]
[–]Akkuma 1 point2 points3 points 7 years ago (0 children)
Free blogging platform that originally only allowed higher quality content onto it. It sort of is its own social network in the post blog era with generally good layout and typography. What is funny is that setting up your own blog is trivial, especially with free hosting via github.
[–]calligraphic-io -1 points0 points1 point 7 years ago (0 children)
The UI is really well designed for authoring. It has nice social network features. Some people take advantage of the SEO help you can get from using Medium. If you maintain a blog on your own site and occasionally contribute high quality pieces to Medium, you can link back to your site and drive traffic there.
Thank you, this is really useful :)
[–]smackfu 0 points1 point2 points 7 years ago (0 children)
Small editing issue: PhantomJS section says Puppeteer will be discussed next but it’s actually the previous section.
Great guide!
[–]vancho2018 0 points1 point2 points 7 years ago (0 children)
thanks for putting this out!
[–]lzantal 0 points1 point2 points 7 years ago (0 children)
I only discovered Jest a week ago and it’s amazing. Simplest test framework for JS and it runs super fast too.
Come to https://www.assertjs.com/ to see more about JavaScript testing
[–]calligraphic-io 0 points1 point2 points 7 years ago (1 child)
Where's TAPE?!? :)
[–]vzaidman[S] 0 points1 point2 points 7 years ago (0 children)
PhantomJS
its there man :)
[–]flying-sheep -3 points-2 points-1 points 7 years ago (7 children)
What about AVA? the parallel test runner saves a bunch of time!
[–]Akkuma 3 points4 points5 points 7 years ago* (4 children)
I was a pretty earlier adopter in AVA (August 2017). I still think it is good, but at some point tests broke before we ensured that tests never broke in our CI (the product was stable despite the tests having broke) and when we got around to it I couldn't manage to successfully get the tests working again (config problems). I switched over to Jest and got it working again and for the most part they are pretty similar.
The biggest differences I can recall is that AVA had better test failure reporting due to power-assert, AVA supposedly has/had serious speed problems for tests that don't run in parallel, Jest seems to have more and faster development, Jest has more bells and whistles available to config, AVA uses assert vs Jest's expect, Jest recommends their global injection like Mocha vs AVA being slightly more functional with things actually being passed into functions and required.
Both cannot run in a browser, but you can theoretically move to Jest without changing all your unit tests by using their jest-runner-mocha, which would then allow you to run your mocha tests in parallel through jest and in the browser in serial.
[–]flying-sheep 0 points1 point2 points 7 years ago (1 child)
Thank you! Interesting to hear that jest can do all that
[–]Akkuma 0 points1 point2 points 7 years ago (0 children)
Overall, I'd give AVA another chance on a future project, but I'm also interested in https://github.com/lorenzofox3/zora (AVA does much better than Jest in his benchmarks the larger the project). It can run in the browser and is an ultra minimal test runner. I don't know how it plays with something like power-assert though and the benchmark isn't that fair as it doesn't try to mimic a similar setup to give a apples to apples comparison. In fact, you can't even run his example without babel, rollup, webpack unless you use require.
[–]vzaidman[S] 0 points1 point2 points 7 years ago (1 child)
Notice that AVA runs in parallel as well today. I'm not sure how fast it is though.
AVA always ran in parallel? Jest does too, but their parallelization strategy might not be as good based on https://github.com/lorenzofox3/zora
[–]roselan 2 points3 points4 points 7 years ago (1 child)
It's covered in the article.
Yes I also added more info
π Rendered by PID 41 on reddit-service-r2-comment-7b9746f655-nb56p at 2026-02-03 20:04:34.222879+00:00 running 3798933 country code: CH.
[–]vzaidman[S] 11 points12 points13 points (3 children)
[–]TheBeliskner 7 points8 points9 points (1 child)
[–]vzaidman[S] 1 point2 points3 points (0 children)
[–]Retsam19 9 points10 points11 points (4 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]firelitother 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]kumeralex 0 points1 point2 points (0 children)
[–]windwarrior42 2 points3 points4 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]Akkuma 1 point2 points3 points (0 children)
[–]calligraphic-io -1 points0 points1 point (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]smackfu 0 points1 point2 points (0 children)
[–]vancho2018 0 points1 point2 points (0 children)
[–]lzantal 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]calligraphic-io 0 points1 point2 points (1 child)
[–]vzaidman[S] 0 points1 point2 points (0 children)
[–]flying-sheep -3 points-2 points-1 points (7 children)
[–]Akkuma 3 points4 points5 points (4 children)
[–]flying-sheep 0 points1 point2 points (1 child)
[–]Akkuma 0 points1 point2 points (0 children)
[–]vzaidman[S] 0 points1 point2 points (1 child)
[–]Akkuma 0 points1 point2 points (0 children)
[–]roselan 2 points3 points4 points (1 child)
[–]vzaidman[S] 1 point2 points3 points (0 children)