Some checks failed
CI / lint-and-test (push) Has been cancelled
- package.json: remove @tensorflow/tfjs and @tensorflow/tfjs-node. Monster's TF code was already stripped; the deps were stale and kept pulling a heavy native binary back into every install. - .gitignore: ignore .repo-mem/ regenerable indexes and per-session .claude/*.lock runtime files. - CLAUDE.md: prepend READ-FIRST pointer to .claude/rules/repo-mem.md; collapse the 'three outputs' bullet to a pointer at node-architecture. - .claude/rules/telemetry.md: drop Port 0/1/2 duplication; reference node-architecture.md. - .claude/rules/testing.md: stop requiring a separate test/edge tier and the basic/integration/edge example flow trio. Reflects what nodes actually do. - .claude/rules/repo-mem.md (new): when-to-call-which guide for the per-repo memory MCP, anti-patterns, refresh model. - .mcp.json (new): wire repo-mem stdio server. - docs/DEVELOPER_GUIDE.md (new): step-by-step guide for adding a new EVOLV node under the three-layer pattern. - Bump nodes/pumpingStation to 6ab585b (docs + simulations refresh, spill-flow path renames consistent with d8490aa). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
32 lines
1.2 KiB
Markdown
32 lines
1.2 KiB
Markdown
---
|
|
paths:
|
|
- "nodes/*/test/**"
|
|
---
|
|
|
|
# Testing Rules
|
|
|
|
## Test Structure
|
|
Every node has at minimum:
|
|
- `test/basic/*.test.js` — Unit tests for individual functions (specificClass domain logic)
|
|
- `test/integration/*.test.js` — Node interaction and message passing tests
|
|
- `test/helpers/` (optional) — Shared test utilities for this node
|
|
|
|
Edge-case tests live wherever they fit (in `basic/` for pure-logic edges, in `integration/` for runtime edges). Don't require a separate `test/edge/` directory.
|
|
|
|
## Test Runner
|
|
```bash
|
|
node --test nodes/<nodeName>/test/basic/*.test.js
|
|
node --test nodes/<nodeName>/test/integration/*.test.js
|
|
```
|
|
|
|
## Test Requirements
|
|
- Every behavior change requires a failing-before/passing-after test
|
|
- Tests must validate against function anchor expected behavior
|
|
- Example flows (`examples/`) must stay in sync with implementation
|
|
|
|
## Example Flows
|
|
Each node should ship at least one runnable example under `examples/` plus an `examples/README.md` describing it. Beyond that, add only what the node's complexity demands — not every node needs separate basic/integration/edge flow files.
|
|
|
|
## No Node-RED Runtime in Unit Tests
|
|
Basic tests should test specificClass domain logic without requiring a running Node-RED instance.
|