Skip to content

Test harness: run behaviour tests against the source tree, fix error-preference leak into Pester - #3

Merged
ArchitektApx merged 8 commits into
masterfrom
fix/test-harness-port
Aug 31, 2026
Merged

Test harness: run behaviour tests against the source tree, fix error-preference leak into Pester#3
ArchitektApx merged 8 commits into
masterfrom
fix/test-harness-port

Conversation

@ArchitektApx

Copy link
Copy Markdown
Owner

Fixes two test-harness defects, a loader bug and class/enum documentation.

Error-preference leak. The runners set $ErrorActionPreference = 'Stop' at file scope, which Pester scopes inherit, so tests asserting a non-terminating error saw a throw instead and failed. Fixed by lowering to Continue around Invoke-Pester only; Tests/Harness.Tests.ps1 adds a regression test.

Tests only ran against the build output. Behaviour tests now import the tree picked by -Target (default Source), so failures name a source file and line; artifact tests in Module.Tests.ps1 keep reading Dist/ and gain stale-build and build-integrity checks. test/coverage build first, -Path selects test files, coverage reports per source file, and CI runs one step per target because two Pester runs poison one process.

Loader bug. The dev loader did not recurse into source subdirectories while ModuleBuilder does; now -Recurse | Sort-Object FullName, matching build order exactly.

Class/enum limits (alphabetical load order, no using module between source files, types only visible from the built manifest) are documented in Docs/CLASSES_AND_ENUMS.md, template-only, deleted by prepare.

@ArchitektApx
ArchitektApx merged commit bfad476 into master Aug 31, 2026
8 checks passed
@ArchitektApx
ArchitektApx deleted the fix/test-harness-port branch August 31, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant