Part 1: Introduction and running a sample test with Mocha and Chai

Mocha is an open-source Javascript test framework that runs on Nodejs and on the browser and is used for testing Synchronous and Asynchronous code. Being my favorite type of coffee and also one of the most depended upon modules on npm according to Libraries.io, I thought it would be a good idea to write a series of articles about it. This first article will give you a solid introduction to Mocha and using it with Node.js. For this series, you will need to have Node and npm installed.

Mocha provides functions that are executed in a specific order and logs…


Hello there, welcome back to this article series of Javascript testing with Mocha and Chai. If you haven’t seen the first article of the series, have a read.

Now, after that coffee break, today we’ll be discussing how to test a simple REST API with Mocha and Chai in detail. So open up your editors and let’s get going. The code for this series can be found on Github.

In this article, we will add to our list of dependencies. Make sure to have these installed first:

npm i body-parser lowdb uuid supertest express

body-parser: This is a middleware that…


CHALLENGE

Return ‘true’ if a word is a palindrome and ‘false’ if not.

EXPLANATION

What is a Palindrome? It is a word or a sentence that is spelled the same both forward and backward, ignoring the punctuation, casing, and spacing. An example is the word ‘Racecar’. To check for a palindrome in Javascript, you will need to remove all non-alphanumeric characters(punctuations, symbols, and spaces)then turn all the letters into lowercase.

In order to remove the non-alphanumeric letters, we shall use a Regular Expression(Regex). Regular Expressions are patterns used to match character combinations in strings. …


If you are planning to kickstart or improve software testing in your system and are looking to venture more into automation rather than manual testing, then look no further. In this article, I will discuss the Test Pyramid in-depth and help you understand its core foundations and why they are valuable in automation testing.

As displayed above, the Test Pyramid is simply a 3-layered pyramid that defines the types of tests to be included in your test plan, the sequence of the tests, and the frequency in which they will be run. The most outstanding benefit of using this test…

Cedric Damian

QA Automation Engineer and part-time Frontend dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store