use internals DI seam pattern for test-injectable functions

SkillDev tools

use _internals DI seam pattern for test-injectable functions

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the use internals DI seam pattern for test-injectable functions skill

What this skill tells your AI

The instructions your AI receives, as published by zaxbyhub/opencode-swarm in .opencode/skills/generated/use-internals-di-seam-pattern-for-test-injectable-functions/SKILL.md and read by ahel’s review.

Trigger

  • (no explicit trigger metadata; cluster derived from category/tags)

Required Procedure

  • use _internals DI seam pattern for test-injectable functions
  • spread real module exports when mocking node built-ins (import * as real from 'node:module'; mock.module('node:module', () => ({ ...real, targetFn: mockFn })))
  • verify mock isolation by running test files in combined mode, not individually

Forbidden Shortcuts

  • rely on mock.module() isolation between test files in bun:test
  • declare a test passing based solely on individual file execution

Delegation Template

When delegating a task affected by this skill, include:

SKILLS: file:.opencode/skills/generated/use-internals-di-seam-pattern-for-test-injectable-functions/SKILL.md

Reviewer Checks

  • Verify each required action above appears in the diff.

Test Engineer Checks

  • Add or update tests covering the trigger condition and the forbidden shortcut.

Source Knowledge IDs

  • 8a374ec6-734e-4b34-9119-1b6148db3a1e — In Bun's shared test-runner process, mock.module() leaks across test files. Always use _internals DI seams or spread-real-exports for node:fs/child_process mocks instead of bare mock.module().

Signals

GitHub stars
467
Forks
51
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
use-internals-di-seam-pattern-for-test-injectable-functions
Source
github.com/zaxbyhub/opencode-swarm