Рет қаралды 3,395
►Kumar Programming - Keep Learning in a simple way
#5 - Hooks (before , after , beforeEach , afterEach) | Nested Test Suite | Skip/Only | Mocha Chai Testing in TypeScript & Node
This is 5th video of this series, hope you are learning well. In this video we have covered Sinon library and lerned about Spy Stub and Mock and how we can use them to write our test cases.
► Topics covered in this Series
1. Introduction -Unit Testing Mocha Chai - Done
2. Installation and Writing Test Suites and Test cases and Running Test cases (describe , it) - Done
3. Chai - Different Chai Assertion Styles (assert, expect, should) - Done
4. Common Chai Assertions - Done
5. Hooks (before, after, beforeEach, afterEach) - Done
6. Nested Test Suites- Done
7. Skipping and Focusing Tests (skip, only) - Done
8. Sinon (Spying, Mocking and Stubbing) - Done
9. Asynchronous Testing - (async await)
10. Testing Promise
11. Nock - Mock Api Calls and data
12. GET POST Api Testing
13. Code Coverage and Reporting (nyc-Istanbul)
► Used Framework and libraries
Mocha - Unit testing framework is the most popular framework for TypeScript/Javascript unit testing.
In this series, I used below popular libraries
Chai - for assertion with with multiple assertion style
Sinon - for spying , mocking and stubbing
Nock - for async api mocking
Nyc - Unit test coverage report by nyc Istanbul and configurations
► Sample code on github:
github.com/kyp...
► Subscribe :
Subscribe Kumar Programming to watch more tutorials:
/ @kyprogramming
/ @kyprogramming
If you have not subscribed yet then please SUBSCRIBE and do not forgot to press the bell icon in order to get notification for all my upcoming videos as well as please like and share to the others as well.
#Mocha #chai #UnitTesting #TypeScrriptUnitTesting #TSUnitTesting #typescript #typescripttutorial #JSUnitTesting #programming #coding #nodejs #nodejstutorial #kumarprogramming #kyprogramming #stepbystep #learning #learning #Hooks