-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Labels
testsThe issue or pull request is about tests only.The issue or pull request is about tests only.
Description
Description
Throughout the project's test files, there are instances where commands are wrapped with assertions. According to the project's coding guidelines, this pattern should be avoided.
Current Issue
Tests currently use patterns like:
{
Some-Command -ErrorAction 'Stop'
} | Should -Not -ThrowRequired Change
Replace with direct invocation:
$null = Some-Command -ErrorAction 'Stop'Scope
This affects all test files matching the pattern:
tests/Unit/**/*.Tests.ps1tests/Integration/**/*.Integration.Tests.ps1
Guidelines Reference
From the project's test guidelines: "Do not use Should -Not -Throw; invoke commands directly"
Background
This issue was identified during review of PR #2245 where the pattern was found in the new integration test file tests/Integration/Commands/Remove-SqlDscTraceFlag.Integration.Tests.ps1.
Backlinks
Metadata
Metadata
Assignees
Labels
testsThe issue or pull request is about tests only.The issue or pull request is about tests only.