Mocha Sauce for JavaScript Unit Tests, Created by Paul Bakaus
Sauce AI for Test Authoring: Move from intent to performance in minutes.|xBack to ResourcesBlogPosted<
Sauce AI for Test Authoring: Move from intent to performance in minutes.
|
x
Blog
Mocha Sauce for JavaScript Unit Tests, Created by Paul Bakaus
Paul Bakaus, CTO of Studio 5 at Zynga, and a prodigious doer of things who created jQuery UI and the Aves Engine, make Mocha Sauce for use by the Zynga development team, and he was variety enough to write a little about it. Read on to memorize about why he create Mocha Sauce. You can findMocha Sauce on Github. Mocha Sauceis a bleeding edge labor that connects Mocha with Sauce Labs. It start as a fork of mocha-cloud (a undertaking that unfortunately doesn ’ t appear to be keep any longer), but now lives on its own and comes with lots of extra features and improvements. It ’ s emphatically not stable, but it is being used in production for an unannounced game here within Studio 5 at Zynga, and we like it so far!
So why in the world did I create it? Read on.
Requirements, and trying not to reinvent the wheel
My squad and I take our unit exam torun in the browser(during ontogenesis), as apre-commit hook(running in a headless browser), inmultiple remote VMs / browsers, and finally, we needed them to beintegrated with Jenkinsfor continuous integrating. Based on these requirements, we were contrive to reuse as many existing libraries or framework as possible, and we get at the following set of third party dependencies:
SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.
Mochafor existent unit examination, allowing me to run my unit trial in the browser. Mocha is really feature-rich and modular, and doesn ’ t enforce a particular loading or coding style. Since testing environments are always capable to environmental changes (per undertaking and company), being modular and non-enforcing is indispensable. Mocha likewise has be around for a piece, and thither ’ s quite a bit of community around it.mocha-phantomjsto run the same Mocha test situation in a terminal utilize PhantomJS, which made it trivial to implement a pre-commit hook that runs the test cortege. mocha-phantomjs is awesome, as it endorse a large number of Mocha reporters for output. is an awful service that allows you to automatically instantiate a pristine remote practical machine that runs a specific browser on a specific platform. With WebDriver on node.js, you can spin up a VM and so instrument the remote browser utilise the WebDriver API. It ’ s really elementary and definitely worth the money.
The miss link
But now that we can spin up outside VMs through node.js, how do we run our unit examination suite in that VM, report back its output and collect it somewhere? This is whereMocha Saucecomes in. It builds on the first-class, but cease work of mocha-cloud and mocha-cloud-grid-view and adds many advanced features – we, for instance, needed to be able to use Sauce Connect to create a local tunnel, which then countenance you to examine firewalled or local urls in the VMs, and we also needed to integrate it with Jenkins, amongst many other smaller thing. I could copy all of its documentation and paste it here but that would be slow. I boost you to simplyread into the docsto get an idea about its features and usage. There ’ s also in-depth info of how to set it up. Keep in mind that this is alpha code, and probably will break here and there. If you do have requirements similar to mine, give it a shot and submit lots of feedback via Twitter to@pbakausor e-mail to pbakaus @ zynga. Now test your units!
Automate This With SUSA
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.
Try SUSA FreeTest Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free