Using the **{test_framework}** testing framework, write a test suite for the following JavaScript function.

**IMPORTANT**: You MUST use {test_framework} syntax. If {test_framework} is "vitest", use `vi.mock()` and `vi.fn()`. If {test_framework} is "jest", use `jest.mock()` and `jest.fn()`. Do NOT mix frameworks.

**Function to Test:**
```javascript
{function_code}
```

**CRITICAL: Use this exact import statement - copy it EXACTLY as shown, do NOT add .js or any file extension:**
```javascript
{import_statement}
```

**CRITICAL: VITEST IMPORTS REQUIRED**
If test_framework is "vitest", you MUST import test functions from 'vitest' since globals are NOT enabled:
```javascript
import {{ describe, test, expect, vi, beforeEach, afterEach }} from 'vitest';
```
For "jest", globals are typically enabled so no import is needed.

**Template to Follow:**
```javascript
// vitest imports (REQUIRED for vitest - globals are NOT enabled by default)
import {{ describe, test, expect, vi, beforeEach, afterEach }} from 'vitest';
// function import
{import_statement}

// unit tests
describe('{function_name}', () => {{
    // Basic Test Cases
    describe('Basic functionality', () => {{
        test('should handle normal input', () => {{
            // Test implementation
        }});
    }});

    // Edge Test Cases
    describe('Edge cases', () => {{
        test('should handle edge case', () => {{
            // Test implementation
        }});
    }});

    // Large Scale Test Cases
    describe('Performance tests', () => {{
        test('should handle large inputs efficiently', () => {{
            // Test implementation
        }});
    }});
}});
```

{package_comment}

Reply only with code, in a single markdown code block.
