Getting started with Mocha


(Heather) #1

I’m moving to a company that uses Mocha with Javascript as part of their automation. This is not something I’ve had experience with before but learning on the job isn’t a problem.

When I was trying to learn Selenium it took me a very long time to find helpful tutorials for it. With a quick look around on Google I’ve found some guides on the Mocha site and a GitHubGist.

Has anyone got experience with Mocha? Would you recommend these or others? I’m keen to not end up in the same situation I did with Selenium if I can!


Club Posts To Help You Get Started With Software Testing And QA
(Joseph) #2

Here’s my reply to your question. I’m not able to reply directly as there are >2 hyperlinks in the text!


(Matt) #3

I use Mocha with a current client.

It’s very similar in design to both RSpec (ruby) and Jasmine (js), which is worth bearing in mind - you could probably even reuse a lot of the code and rejig the syntax.

If you need somewhere to start, I made a github repo with some example API tests here: https://github.com/opencredo/js-api-testing-quickstart

The javascript may look a little different to the code you work with, as I’m using Babel (transpiling from ES2015) and Flow (type checking).