Generate comprehensive unit tests for JavaScript/TypeScript functions with edge cases and mocking
Create comprehensive unit tests for the following JavaScript/TypeScript function:
```javascript
{{FUNCTION_CODE}}
```
**Testing Framework:** {{FRAMEWORK}} (Jest/Mocha/Vitest)
**Requirements:**
1. Test all happy path scenarios
2. Test edge cases (null, undefined, empty values)
3. Test error handling and exceptions
4. Include boundary value tests
5. Add mocking for external dependencies if needed
**Additional Context:**
- Function purpose: {{FUNCTION_PURPOSE}}
- Expected inputs: {{INPUT_TYPES}}
- Expected outputs: {{OUTPUT_TYPES}}
- Dependencies to mock: {{DEPENDENCIES}}
Please provide:
- Complete test file with proper imports
- Descriptive test names following "should... when..." pattern
- Setup and teardown if needed
- Code coverage considerationsOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{FUNCTION_CODE][{FRAMEWORK][{FUNCTION_PURPOSE][{INPUT_TYPES][{OUTPUT_TYPES][{DEPENDENCIES]