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

{% block role_qualifier %} using Mocha and Node.js built-in assert{% endblock %}
{% block framework_instruction %}- Write each test with `it('description', () => { ... });` using `describe` blocks for organization.{% endblock %}

{% block framework_rules %}
<rules>
**CRITICAL: IMPORT PATH RULES**:
- **NEVER add file extensions (.js, .ts, .tsx) to import paths** - The test framework resolves extensions automatically.
- **WRONG**: `const { fn } = require('../utils.js')` or `const { fn } = require('../utils.ts')`
- **CORRECT**: `const { fn } = require('../utils')`
- The user message provides the exact import statement to use - copy it exactly without modification.

**ASSERTION AND TEST FRAMEWORK: Mocha + node:assert/strict**

This project uses **Mocha**. The ONLY assertion module available is **node:assert/strict** (built into Node.js).

- `describe` and `it` are **Mocha globals** — they require no import.
- Import assert with: `const assert = require('node:assert/strict');`
- Write each test with `it('description', () => { ... });`

Available assertion methods:
- `assert.strictEqual(actual, expected)` — primitive equality (numbers, strings, booleans)
- `assert.deepStrictEqual(actual, expected)` — object/array deep equality
- `assert.throws(() => { ... })` — verify a function throws an error
- `assert.ok(value)` — verify a value is truthy
- `assert.notStrictEqual(actual, expected)` — verify values are not equal

Example test:
```javascript
const assert = require('node:assert/strict');
const { myFunc } = require('../myModule');

describe('myFunc', () => {
    it('should return 42 for valid input', () => {
        assert.strictEqual(myFunc(21), 42);
    });
    it('should return an array', () => {
        assert.deepStrictEqual(myFunc(), [1, 2, 3]);
    });
    it('should throw on invalid input', () => {
        assert.throws(() => { myFunc(null); });
    });
});
```
</rules>
{% endblock %}

{% block test_signature %}test using `it()`{% endblock %}

{% block md_role_qualifier %} using Mocha and Node.js built-in assert{% endblock %}
{% block md_framework_instruction %}- Write each test with `it('description', () => { ... });` using `describe` blocks for organization.{% endblock %}

{% block md_framework_rules %}

## Import Path Rules

- **NEVER add file extensions (.js, .ts, .tsx) to import paths** - The test framework resolves extensions automatically.
- **WRONG**: `const { fn } = require('../utils.js')` or `const { fn } = require('../utils.ts')`
- **CORRECT**: `const { fn } = require('../utils')`
- The user message provides the exact import statement to use - copy it exactly without modification.

## Assertion and Test Framework: Mocha + node:assert/strict

This project uses **Mocha**. The ONLY assertion module available is **node:assert/strict** (built into Node.js).

- `describe` and `it` are **Mocha globals** — they require no import.
- Import assert with: `const assert = require('node:assert/strict');`
- Write each test with `it('description', () => { ... });`

Available assertion methods:
- `assert.strictEqual(actual, expected)` — primitive equality (numbers, strings, booleans)
- `assert.deepStrictEqual(actual, expected)` — object/array deep equality
- `assert.throws(() => { ... })` — verify a function throws an error
- `assert.ok(value)` — verify a value is truthy
- `assert.notStrictEqual(actual, expected)` — verify values are not equal

Example test:
```javascript
const assert = require('node:assert/strict');
const { myFunc } = require('../myModule');

describe('myFunc', () => {
    it('should return 42 for valid input', () => {
        assert.strictEqual(myFunc(21), 42);
    });
    it('should return an array', () => {
        assert.deepStrictEqual(myFunc(), [1, 2, 3]);
    });
    it('should throw on invalid input', () => {
        assert.throws(() => { myFunc(null); });
    });
});
```
{% endblock %}

{% block md_test_signature %}test using `it()`{% endblock %}
