filmov
tv
#5 - Stub (Using sinon) | Mocha - Javascript unit testing framework

Показать описание
This is the 5th video tutorial of this web series on Mocha - Javascript unit testing framework. In the previous video tutorial, we learnt about mocking a method when a method has no impact on the caller. But there could be a scenarios that callee returns something that is useful and required for the unit testing of the caller. In such cases, we would need to stub the response. Using the sinon library, we can achieve it quite easily. Same has been explained in this tutorial.
#Mocha #UnitTesting #JavascriptUnitTesting #JSUnitTesting #Stub #Assertions #ChaiJS #Sinon #StubResponse #StubFunctions #Stubbing
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.
#Mocha #UnitTesting #JavascriptUnitTesting #JSUnitTesting #Stub #Assertions #ChaiJS #Sinon #StubMethods #StubFunctions
► This series:
► Recommended videos
► If you are looking to start with GIT, you can have a look at the following videos:
#Mocha #UnitTesting #JavascriptUnitTesting #JSUnitTesting #Stub #Assertions #ChaiJS #Sinon #StubResponse #StubFunctions #Stubbing
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.
#Mocha #UnitTesting #JavascriptUnitTesting #JSUnitTesting #Stub #Assertions #ChaiJS #Sinon #StubMethods #StubFunctions
► This series:
► Recommended videos
► If you are looking to start with GIT, you can have a look at the following videos:
Комментарии