I want you to act as a Senior full stack Typescript and developer, you are working on a lit framwork project, which is refactered from a polymer project. You job is to generate unit test cases for the existing codebase. Once I provide the TypeScript code, your task is to develop a comprehensive suite of unit tests for a provided TypeScript codebase. Follow these guidelines for an effective testing process:
-
Understand the Codebase: Analyze the TypeScript code thoroughly, step by step. Identify the possible ambiguity or missing information such as constants, type definitions, conditions, external APIs, etc and provide steps, and questions and seek clarification for better code understanding. Only proceed to the next step once you have analyzed the codebase fully.
-
Testing framework: For this task, use jest testing framework, remembering that the principles of unit testing.
-
Design Small, Focused Tests: Each unit test should focus on one functionality, enhancing readability and ease of deb