{% extends "base_system.md.j2" %}

{% block role_qualifier %} for **asynchronous** code{% endblock %}
{% block task_target %}**async** {{ function_name }}{% endblock %}
{% block task_qualifier %} with proper async/await handling{% endblock %}

{% block async_section %}
<async_requirements>
**CRITICAL: ASYNC TEST REQUIREMENTS**
- The function under test is **asynchronous** - all tests must handle async properly
- Use `async/await` syntax in test functions
- Ensure all promises are awaited
- Test both successful resolution and rejection scenarios
- Handle async timeouts appropriately
</async_requirements>
{% endblock %}

{% block categories %}
**1. Basic Test Cases**:
- **Objective**: To verify the fundamental async functionality of the {{ function_name }} function under normal conditions.

**2. Edge Test Cases**:
- **Objective**: To evaluate the async function's behavior under extreme or unusual conditions, including error handling.

**3. Large Scale Test Cases**:
- **Objective**: To assess the async function's correctness and scalability with larger inputs.
{% endblock %}

{% block determinism_rule %}- **CRITICAL: TESTS MUST BE DETERMINISTIC** - Every test must produce the same pass/fail result on every run against the same code. Never assert on execution timing, elapsed duration, or the relative ordering of async side effects. Only assert on return values, resolved/rejected outcomes, and observable state.
{% endblock %}

{% block extra_instructions %}- **CRITICAL: TEST REJECTION CASES** - Use `expect(...).rejects.toThrow()` for testing async errors.
{% endblock %}

{% block test_signature %}async test using `test('...', async () => ...)`{% endblock %}

{% block md_role_qualifier %} for **asynchronous** code{% endblock %}
{% block md_task_target %}**async** {{ function_name }}{% endblock %}
{% block md_task_qualifier %} with proper async/await handling{% endblock %}

{% block md_async_section %}

### CRITICAL: ASYNC TEST REQUIREMENTS
- The function under test is **asynchronous** - all tests must handle async properly
- Use `async/await` syntax in test functions
- Ensure all promises are awaited
- Test both successful resolution and rejection scenarios
- Handle async timeouts appropriately
{% endblock %}

{% block md_categories %}

**1. Basic Test Cases**:
- **Objective**: To verify the fundamental async functionality of the {{ function_name }} function under normal conditions.

**2. Edge Test Cases**:
- **Objective**: To evaluate the async function's behavior under extreme or unusual conditions, including error handling.

**3. Large Scale Test Cases**:
- **Objective**: To assess the async function's correctness and scalability with larger inputs.
{% endblock %}

{% block md_determinism_rule %}- **CRITICAL: TESTS MUST BE DETERMINISTIC** - Every test must produce the same pass/fail result on every run against the same code. Never assert on execution timing, elapsed duration, or the relative ordering of async side effects. Only assert on return values, resolved/rejected outcomes, and observable state.
{% endblock %}

{% block md_extra_instructions %}- **CRITICAL: TEST REJECTION CASES** - Use `expect(...).rejects.toThrow()` for testing async errors.
{% endblock %}

{% block md_test_signature %}async test using `test('...', async () => ...)`{% endblock %}
