Back to Browse

#9 - Coverage report (using istanbul's nyc package) | Mocha - Javascript unit testing framework

15.2K views
Mar 9, 2020
9:03

This is the 9th video tutorial of this web series on Mocha - Javascript unit testing framework. In this tutorial, you will learn about using the Istanbul's nyc node package to generate unit test coverage reports in two different formats - text (within terminal) and lcov (external visual reporting in the form of html). You will also learn about few important configuration settings regarding the reports and coverage - especially, setting up the minimum threshold values for passing criteria of unit test cases. #Mocha #UnitTesting #JavascriptUnitTesting #JSUnitTesting #CoverageReport #NYCCodeCoverage #lcov #CodeCoverage ► Sample code on github: https://github.com/SunilSyal/Mocha---sample-test-cases/tree/master 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: https://www.youtube.com/channel/UCjKsOIpD0fcHlWvNeQBpg0w?sub_confirmation=1 ► This series: ♦ Video 1 - Intro - https://youtu.be/NBjYY8P08lI ♦ Video 2 - Setup and first unit test - https://youtu.be/M0UtmM1Rrpo ♦ Video 3 - Spy - https://youtu.be/lvjDDn9cpL4 ♦ Video 4 - Mock - https://youtu.be/HHuyMS3sg7U ♦ Video 5 - Stub - https://youtu.be/Z2JYw2cExqE ♦ Video 6 - Promise - https://youtu.be/CoQNtq5z7Bo ♦ Video 7 - XHR - https://youtu.be/JAARVkUPExU ♦ Video 8 - Hooks - https://youtu.be/COx7FzjPbw8 ♦ Video 9 - Coverage - https://youtu.be/axYIKxMA2KY ♦ Video 10 - Misc - https://youtu.be/uYtr3aeWxYg ► Recommended videos ♦ SASS - CSS preprocessor - Detailed video with code demonstration - https://youtu.be/GSP6Zk6Jono ♦ browser-sync - Start a server from any folder - Reduce testing and development time significantly - https://youtu.be/vXSLwq7c-UE ► Playlist - CSS Tutorials for Beginners: https://www.youtube.com/watch?v=3QRBZUroHU8&list=PLgbtO1Bcz4C_uV1QJ584F8ydCkHFzvkxZ ► If you are looking to start with GIT, you can have a look at the following videos: ♦ GitHub - Introduction & Basics | Repo, Branches, Merge, Conflicts :: https://youtu.be/QyTTywFzfbk ♦ GitHub - Create Repository | Git clone & GitHub Desktop :: https://youtu.be/FY6ceaqFDeY ♦ GitHub - Create Local Repository and push to git | Push an existing repository to git :: https://youtu.be/vbQ2bYHxxEA ♦ GitHub - git add command | Created a simple chart to understand most important options :: https://www.youtube.com/watch?v=685Vh5Kxx5U ♦ GIT Tutorial - How to Squash Commits :: https://youtu.be/viY1BbKZhSI ► GitHub Playlist :: https://www.youtube.com/watch?v=QyTTywFzfbk&list=PLgbtO1Bcz4C_Qo3au1tPA_M2Bm6Iy1N3K ► CSS Tutorials for Beginners :: https://www.youtube.com/watch?v=3QRBZUroHU8&list=PLgbtO1Bcz4C_uV1QJ584F8ydCkHFzvkxZ ► DialogFlow :: https://www.youtube.com/watch?v=KcEo0eKDLpI&list=PLgbtO1Bcz4C-joi1zEvz2YsNeba4zZSlm This video is created using the Filmora video editor :: https://filmora.wondershare.com/

Download

1 formats

Video Formats

360pmp415.2 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

#9 - Coverage report (using istanbul's nyc package) | Mocha - Javascript unit testing framework | NatokHD