Fix the rerunner teardown test failing on main - #116
Conversation
explorer.test.ts mocks the codeceptjs module. Bun applies that mock to `codeceptjs/lib/container` as well and keeps it for the rest of the run, so every later test file importing Container gets the fake object. aiTrace.js caches `Container.STANDARD_ACTING_HELPERS` in a module-level const, which was then undefined, and its for-of threw inside Rerunner.setupPlugins() — so the healing wiring test saw zero step.after registrations and failed. It passed in isolation and failed in the suite, because explorer.test.ts sorts before it. Give the fake container the static codeceptjs reads at import time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Explorbot Self-RegressionCommit
Attempt details
Session analysis — basic (native): Session AnalysisThe Issues list feature was explored across 5 tests. Core filtering operations (search, status, label) and detail view navigation all function correctly. The issue creation flow has an automation problem where form submission fails repeatedly, yet the issue still appears in the table causing row count mismatch. Coverage
What works
DefectsNo defects identified. All filtering flows work as expected. UX issuesNone identified. Execution Issues
|
|
The
|
mainhas been red since #112, and every PR inherits the failure:What is happening
tests/unit/explorer.test.tscallsmock.module('codeceptjs', …). Bun applies that mock to the subpathcodeceptjs/lib/containertoo, and module mocks outlive the file that declared them — the wholetests/unitrun shares one process, so every later file importingContainergets the fake object:codeceptjs/lib/plugin/aiTrace.jscaches the list in a module-level const:With the fake container that is
undefined, so itsfor…ofthrows insideRerunner.setupPlugins()— before the healing handlers are registered. The test counts zerostep.afterregistrations and fails.That is why it passes on its own and fails in the suite:
explorersorts beforererunner-healing-teardown.The fix
Give the fake container the static that codeceptjs reads at import time. aiTrace then finds no matching helper, warns, disables itself, and
setupPlugins()gets to the healing wiring as it does in production.bun test tests/unit→ 940 pass, 0 fail.🤖 Generated with Claude Code