#2 - Setup & First unit test case | Mocha - Javascript unit testing framework
This is the 2nd video tutorial of this web series on Mocha - Javascript unit testing framework. In the previous tutorial () we talked about the topics that we will cover in this web series. In this tutorial, we will do a basic setup of Mocha framework on our machine. Also, we will write our first test case to test a simple method written inside a class by creating an object of the class in the spec file. Also, you will be introduced to assertion library Chai JS and its interface - “expect“.
#Mocha #UnitTesting #JavascriptUnitTesting #JSUnitTesting #SetupUnitTestingFramework #Assertions #ChaiJS #Sinon #HowToWriteUnitTests
► Sample code on github:
Mocha unit testing framework is the most popular framework for Javascript unit testing. In this web series, I have used other popular libraries
- Chai - as assertion library with expect interface
- Sinon - for spies, mocks and stubs
- Nock - for xhr interception and mocking
- Nyc - Unit test coverage report and its important configurations
Hope you will learn good from this course. Let me know your feedback, suggestions - I will really appreciate it.
Subscribe Study Zone and watch more tutorials:
► This series:
♦ Video 1 - Intro -
♦ Video 2 - Setup and first unit test -
♦ Video 3 - Spy -
♦ Video 4 - Mock -
♦ Video 5 - Stub -
♦ Video 6 - Promise -
♦ Video 7 - XHR -
♦ Video 8 - Hooks -
♦ Video 9 - Coverage -
♦ Video 10 - Misc -
► Recommended videos
♦ SASS - CSS preprocessor - Detailed video with code demonstration -
♦ browser-sync - Start a server from any folder - Reduce testing and development time significantly -
► Playlist - CSS Tutorials for Beginners:
► If you are looking to start with GIT, you can have a look at the following videos:
♦ GitHub - Introduction & Basics | Repo, Branches, Merge, Conflicts ::
♦ GitHub - Create Repository | Git clone & GitHub Desktop ::
♦ GitHub - Create Local Repository and push to git | Push an existing repository to git ::
♦ GitHub - git add command | Created a simple chart to understand most important options ::
♦ GIT Tutorial - How to Squash Commits ::
► GitHub Playlist ::
► CSS Tutorials for Beginners ::
► DialogFlow ::
This video is created using the Filmora video editor ::
1 view
94
15
3 weeks ago 00:00:00 1
12 Апреля! Запуск Акции + Заработок в интернете! Доходы от 1000$ в месяц! Начало в 17:10 Москвы!
3 weeks ago 00:00:00 1
АКР Арийская Комиссия по Репарациям Прямой ЭФИР АРиЯ [ МСК]
3 weeks ago 00:00:58 1
TVアニメーション『攻殻機動隊 THE GHOST IN THE SHELL』特報第2弾|2026年放送
3 weeks ago 00:04:02 1
Keny Arkana - Eh connard
3 weeks ago 00:03:39 1
Print Like a Boss Anywhere: HP’s Tiny Tank with Big Attitude & Bluetooth Bragging Rights! - YouTube
3 weeks ago 00:54:45 1
МотоВесна 25: «Когда в павильоне больше блогеров, чем тормозных дисков»
3 weeks ago 00:45:16 2
Гонконг: уже хотим вернуться. Где остановиться, куда ходить и что есть?
3 weeks ago 00:16:01 8
Жадность как диагноз. Проклятые миллиарды Путина и его друзей. Миллер, Сечин
3 weeks ago 00:16:31 1
2025년 4월 게이밍 컴퓨터견적, 현시점 최고의 가성비 월간견적 조립PC | 9060 XT, 5060 Ti 출시2
3 weeks ago 00:46:46 1
СТИРАНИЕ ПАМЯТИ Прямой ЭФИР АРиЯ в новую эру 12 лет 111 дней [ 21:21:21 МСК]
3 weeks ago 00:05:04 2
M3GAN 2.0 - Русский трейлер | Реакция
3 weeks ago 00:53:31 1
Mimi Spécial Festival 2025 : L’Un-Connu & Festival de la Merveille & des Mystère
3 weeks ago 00:02:30 4
Пять ночей с Фредди 2 — Русский Трейлер Тизер | Реакция
3 weeks ago 00:25:21 2
Pourquoi les scientifiques nazis ont été récupérés par les Alliés après la guerre ?
3 weeks ago 00:28:25 1
Battlefield 4 Gameplay Playthrough w/ Facecam Part 1 - Fishing in Baku (Mission 1)
3 weeks ago 00:07:14 4
ШОКОЛАДНЫЙ ПИРОГ С ХУРМОЙ - рецепт от шефа Бельковича | ПроСто кухня | YouTube-версия
3 weeks ago 00:28:37 1
10 советских и российских танков, которые были сильнее Арматы.
3 weeks ago 00:00:00 5
ЛЕОНИД АГУТИН. КОНЦЕРТ НА ВТБ АРЕНЕ с группой «Эсперанто» и Тюменским филармоническим оркестром
3 weeks ago 00:08:38 1
ОБНАРОДОВАНИЕ Осталось 140 дней
3 weeks ago 00:03:16 9
--- Dudich, Sophia v Unknown (Dripping Springs High School) 01-30-25 L PIN 2:58
3 weeks ago 01:22:24 3
INTERVJU: Vladimir Vuletić - Studenti su već pobedili! ()
3 weeks ago 00:32:46 1
2 . В детской Поликлинике Областной больницы Смоленска поставили рамку на входе
3 weeks ago 00:01:59 4
126 Dudich, Sophia v Bourland, N. (Austin Lake Travis) 01-30-25 L PIN 2:22
3 weeks ago 00:07:43 1
Path of Exile 2 OPTIMIZATION Guide - BOOST FPS, Fix Lag & FPS Drops on ANY PC📈 / Best Settings!✅