QuAlity Drinks

Tres Bien - Aug 5 - - Dev Community

Header image by Mostafameraji on Wikimedia Commons

Order Up! Expresso, Mocha with Chai, & Jasmine

While working on various educational projects, I noticed the name Mocha popping up. I wondered what it was, so I looked it up and learned that it is a Testing Framework.
I’d heard of a Framework, but none specifically categorized as a ‘Testing’ Framework, so I looked that up too.
Testing Frameworks are Frameworks (obviously, haha!) that are used for writing and running tests on your code to verify that it functions as desired.
Then I went searching more and found out that not only are there a lot of them, but several seem to be named after drinks. Which was amusing enough to make me want to focus on them above the others.

Expresso

Image description

Expresso is a testing framework for Node.js applications.
It was created by TJ Holowaychuk, the creator of Express.js, and was first released May 22, 2010.

Its features involve: being lightweight, having intuitive async support, being test runner executable, having test coverage support and reporting through node-jscoverage, & its extension plus use of the assert module. (Expresso GitHub Docs)

Unfortunately, It is no longer being maintained, possibly because TJ no longer wished to work on Node according to this blog post from July 3, 2014.

The last update was to the Readme 9 years ago in 2015, with it saying he’s not going to Maintain it anymore and to use Mocha instead.

The GitHub Repo has instructions for how to install & use it, but considering it seems abandoned, it may not be worth learning.
Which is a shame because this feels like a waste of a very clever name to me.

Mocha

Image description

Mocha is the framework that started my interest in researching testing Frameworks, and is the one that Expressos creator, TJ, recommended that people use after moving on from Expresso.
Mocha can be run in Node.js and your browser. And works with applications such as Angular, Express, & Vue.

Mocha was created by… Surprise! TJ again!
Which could explain why he recommends dropping Expresso for it.

Although, I honestly haven’t yet found anything outright saying he created it. The context of this 2013 Blog where he was looking for Maintainers of his old projects implies to me that he did, so I’m sticking with this assumption as I keep snooping around.

I am also incredibly curious about why he dropped Expresso and moved on to Mocha, and have spent an absurd amount of time trying to find an answer. But this information continues to elude me, for now.

Chai

Image description

Chai is a BDD / TDD assertion library for Nodejs and browsers. Chai is popular due to its flexibility as it can be paired with any javascript testing framework of your choosing, like Mocha!

I believe that Chai was originally created by Jake Luer, whose GitHub account can be visited here. My snooping has not yet found any articles stating outright that he did. I’m going off of context clues, especially that of the repos history and the incredibly high number of commits he’s made to the project soon after its creation date.

Chai has three writing “styles” that developers can choose from based on which is the most comfortable for them to work in.
The ‘Should’, ‘Expect’, and ‘Assert’ styles each use their own unique syntax, while maintaining consistent underlying functionality.

Chai also accepts assertion plugins and developers can create their own to extend assertions to new contexts, and share them with the community.

Jasmine

Image description

Jasmine is another JavaScript Testing Framework, but can also be used with other languages like Python and Ruby. It is an open-source program that was developed at Pivotal Labs and released in 2010. Jasmine doesn’t require any other dependencies to work but is compatible with other testing frameworks and libraries, such as Chai and Sinon.

Jasmine can be run in either Node.js or a browser, and has a simple setup that uses a CLI tool which creates a spec folder and a JSON configuration file for you. Jasmine also aims to be simple to read while following the Behavior-Driven development style.

Take Out

Image description

It is surprisingly difficult to find information on the history of these Frameworks (and one library). I know the information is out there, somewhere, and I hope to hunt it down someday. I just have to learn where to look.
Or perhaps it is not available because the creators are too busy coding up storms to bother with writing information for curious people like me?
I also think we need more drink themed testing frameworks so perhaps I will make some post-graduation.

Resources

-Wikipedia - Testing Frameworks
-Farewell Node.js

Expresso:
-Libraries IO
-NPM js
-GitHub
-Wikipedia - Express

Mocha:
-Mocha JS
-Wikipedia
-W3Resource
-Geeks For Geeks
-Request for Maintainers

Chai:
-GitHub
-Chai JS

Jasmine:
-Jasmine GitHub IO
-Wikipedia
-Log Rocket

. . . . . . . . .
Terabox Video Player