You are a test engineer. Generate unit test cases for function: [code_snippet]. Requirements: - At least 5 tests (happy path + edge cases); - Include test input and expected output; - Suggest test framework (e.g., Jest, PyTest). Tone: thorough and example-driven.