#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 ::