It's an odd situation here.
While React - the library for which Jest was conceived - is basically just a virtual DOM library and so it's very basic, lately the community is shifting from the highly customizable and pluggable standard of tools (like Gulp, PostCSS or Mocha's ecosystem) to more battery-included solutions (like webpack and Jest) that relieve developers the burden of choosing, setting up and maintaining a boatload of plugins.
At least that's what I feel about the web dev community right now.
Yes, but on a more practical side, it makes little difference: you copy that reference to work with the object it points to.
If you take PHP. instead, as long as they're arrays (for those who don't know the evil of PHP, they're the equivalent of *both* JavaScript's Array and Object instances), it makes *deep* copies of them, and you have to use the & operator to get refrences instead. (Class objects are always passed as in JavaScript instead - did I mention that PHP is evil?)
What do you mean you couldn't figure out how to achieve code coverage with Mocha? You have to run Istanbul on top of it and you're done:
https://istanbul.js.org/docs/tutorials/mocha/
For me, the real new concept of Jest is snapshot testing. It's handy but also quite jarring as it transforms all the tests in a string comparison, so the test logic is moved into the serializers.
Also Jest's watcher is quite nice.
Stopped reading at this:
> for (let index in allImgs)
After all it looks like an article that mixes old and well know hacks (like short circuiting) with new ES6 syntax tricks.
But some completely miss the point: if we do the "longhand" version, maybe there's a reason. That's why I stopped declaring n variables all in one var statement, for example.