node-test-pattern
OfficialWrite consistent node:test tests for the bot
Software Engineering#unit testing#Redis#mocking#node:test#Teams bot#notification consumer#CI reliability
Authorinterserver
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It removes friction and inconsistency when adding tests by giving a canonical, project-specific pattern for using node:test with the Teams Chat Bot’s notification consumer internals.
Core Features & Use Cases
- node:test-only guardrails: Enforces a strict requirement to use
node:testand not Jest/Mocha/other frameworks, matching the repository’s test runner expectations. - Deterministic mock setup: Provides a standard seam via
_setInternalsForTest({ redis, redisBot, adapter })plus hash-map-backed Redis, bot convref Redis mocking, and an adapter mock that records sent/updated activities. - Reliable workspace cleanliness: Ensures trace/log pollution is silenced by setting
process.env.NOTIF_TRACE_LOG = '0'before requiring the consumer.
Quick Start
Use node-test-pattern when you need to add a new test by creating a file under test/ that ends with .test.js, following the required boilerplate and mock wiring, then run the suite with npm test.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: node-test-pattern Download link: https://github.com/interserver/teams-chat-bot/archive/main.zip#node-test-pattern Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.