Context
A test-suite audit (see #2764) surfaced ~58 TODO comments scattered across src/. None are production blockers — the test suite is green and behavior is correct. These are accumulated design-debt notes worth tracking in one place so the information isn't lost in comments. This is housekeeping, not a bug.
Grouped by theme below. Each line is a file:line reference (line numbers approximate; they drift as code changes).
P1 — Latent dead code (cheap wins)
P2 — Dead-code "Remove?" decisions
P3 — Unify error formatting across NUnit/JUnit writers
Several writers format errors locally instead of via one shared core function (so screen vs. report can diverge).
P4 — Mock internals / "resolve path safely"
P5 — Runtime concepts to clarify ("before shipping")
P6 — Coverage breakpoint-merge implementation
P7 — Should-BeEquivalent verbose-output polish
P8 — SkipRemainingOnFailure: expose data via $Context
P9 — Low-priority informational notes (likely leave as-is)
No action is required for production quality; resolve opportunistically. The P1 items are the only quick "real" cleanups.
Context
A test-suite audit (see #2764) surfaced ~58
TODOcomments scattered acrosssrc/. None are production blockers — the test suite is green and behavior is correct. These are accumulated design-debt notes worth tracking in one place so the information isn't lost in comments. This is housekeeping, not a bug.Grouped by theme below. Each line is a
file:linereference (line numbers approximate; they drift as code changes).P1 — Latent dead code (cheap wins)
src/functions/TestResults.NUnit25.ps1:320,334— thereason/messageblock forSkipped/Inconclusiveis unreachable: it guards on$TestResult.FailureMessage, which is never populated for those states (verified — empty at the source, so the emitted NUnit2.5 XML is still valid but the block is dead).:334also guards onFailureMessagebut writesDisplayErrorMessage. Remove or wire up correctly.src/Pester.Runtime.ps1:1069— commented-outWrite-Hostdebug line tagged#TODO; just delete.P2 — Dead-code "Remove?" decisions
src/Pester.Utility.ps1:314,420src/functions/Coverage.ps1:154,170,182— hashtable/IDictionaryconfig syntax: implement or remove.src/functions/Mock.ps1:1841,1861P3 — Unify error formatting across NUnit/JUnit writers
Several writers format errors locally instead of via one shared core function (so screen vs. report can diverge).
src/functions/TestResults.NUnit25.ps1:272,348,349,363src/functions/TestResults.NUnit3.ps1:594,595,614P4 — Mock internals / "resolve path safely"
src/functions/Mock.ps1:1181,1186—$______isInMockParameterFilterhack + bound-parameter binding note.src/functions/Pester.SessionState.Mock.ps1:35,40,45— resolve path safely (×3).src/functions/Pester.SessionState.Mock.ps1:464,557,892P5 — Runtime concepts to clarify ("before shipping")
src/Pester.Runtime.ps1:180,2605—Idused by NUnit2.5/3 grouping; find a better mechanism.src/Pester.Runtime.ps1:1961,1982,2300,2324,2581src/Pester.RSpec.ps1:309,310,314— error-writing logic coupled to a plugin; separation of concerns.P6 — Coverage breakpoint-merge implementation
src/functions/Coverage.ps1:588,595— quick merge of breakpoint lists; avoid splitting/merging twice.src/functions/Coverage.Plugin.ps1:124— check config for coverage mode instead of inferring.P7 —
Should-BeEquivalentverbose-output polishsrc/functions/assert/Equivalence/Should-BeEquivalent.ps1:78,231,244,266,332,592,607,705P8 —
SkipRemainingOnFailure: expose data via$Contextsrc/functions/Get-SkipRemainingOnFailurePlugin.ps1:57,132— use$Context.GlobalPluginData.SkipRemainingOnFailure.*once exposed.P9 — Low-priority informational notes (likely leave as-is)
src/Format.ps1:170·src/Main.ps1:465,584,585·src/Pester.Utility.ps1:449·src/functions/Describe.ps1:195·src/functions/Output.ps1:426·src/functions/TestDrive.ps1:190·src/functions/TestRegistry.ps1:110No action is required for production quality; resolve opportunistically. The P1 items are the only quick "real" cleanups.