How To Write Test Cases In Typed Script . It contains two parameter — one is name of test case and other function. You could do that by giving it dispatch as a prop, so you can mock it for your tests. Unit Test Case for Typescript Webresources Phani Rajasekhar from rajsekhar311.com If you have a code that is shared by multiple cases, you can group them. For example, if a function is supposed to calculate the sum of two numbers, a unit test can be written. Levels of test writing process: