Viscalyx.Assert
1.1.1-preview0001
Assertions for Pester that can improve your tests.
Minimum PowerShell version
5.1
See the version list below for details.
Installation Options
Owners
Copyright
Copyright the Viscalyx.Assert contributors. All rights reserved.
Package Details
Author(s)
- Viscalyx
Tags
Pester Assertion Testing TDD BDD Assert PesterAssertion
Functions
Assert-BlockString Assert-ObjectMethod Assert-ObjectProperty
Dependencies
This module has no dependencies.
Release Notes
## [1.1.1-preview0001] - 2025-10-04
### Added
- `Assert-ObjectProperty`
- Added parameter `NoTypeCheck` to opt-in for lenient type checking, allowing
PowerShell type coercion when comparing values.
- Added private functions:
- `Get-TypeName` - Gets the full type name of a value as a string, or 'null'
if the value is null.
- `New-AssertionError` - Creates a Pester assertion error record with optional
'because' reasoning to standardize error creation across assertion commands.
- `Test-ObjectHasMethod` - Tests whether an object has a specified method,
supporting various object types including PSCustomObjects and .NET objects.
- `Test-ObjectHasProperty` - Tests whether an object has a specified property,
supporting hashtables, PSCustomObjects, and .NET objects.
- `Test-ObjectType` - Tests whether two values have the same type for strict
type checking in assertion commands.
- `Test-ValueEquality` - Tests whether two values are equal, supporting both
scalar values and arrays with structural comparison.
### Changed
- `Assert-ObjectProperty`
- Added parameter `Each` to opt-in for element-by-element checking when
passing arrays via pipeline or parameter. Without this parameter, the
command now checks properties on the array object itself (e.g., `Count`,
`Length`).
- Improved error messages to distinguish between type mismatches and value
mismatches when strict type checking is enabled.
- `Assert-ObjectMethod`
- Added parameter `Each` to opt-in for element-by-element checking when
passing arrays via pipeline or parameter. Without this parameter, the
command now checks methods on the array object itself.
- `Assert-BlockString`
- Refactored to use the `New-AssertionError` private function for consistent
error handling across all assertion commands.
- `New-AssertionError`
- Updated to follow Pester's error message pattern by inserting the `Because`
clause before `, but` in error messages (e.g., "Expected \<value\>, because
\<reason\>, but got \<actual\>").
- Localized strings have been reorganized to consolidate common reusable words
(like "because", "actual", and "expected") into a dedicated "Common localized
strings" section with a consistent `Common_Word*` naming pattern, reducing
duplication across command-specific string keys.
FileList
- Viscalyx.Assert.nuspec
- Viscalyx.Assert.psd1
- Modules\DscResource.Common\0.24.0\en-US\about_DscResource.Common.help.txt
- Modules\DscResource.Common\0.24.0\en-US\DscResource.Common.strings.psd1
- Viscalyx.Assert.psm1
- Modules\Viscalyx.Common\0.7.0\en-US\about_Viscalyx.Common.help.txt
- en-US\Viscalyx.Assert.strings.psd1
- Modules\Viscalyx.Common\0.7.0\en-US\Viscalyx.Common.strings.psd1
- en-US\about_Viscalyx.Assert.help.txt
- Modules\Viscalyx.Common\0.7.0\en-US\Viscalyx.Common-help.xml
- en-US\Viscalyx.Assert-help.xml
- Modules\Viscalyx.Common\0.7.0\Modules\DscResource.Common\0.24.0\DscResource.Common.psd1
- Modules\DscResource.Common\0.24.0\DscResource.Common.psd1
- Modules\Viscalyx.Common\0.7.0\Modules\DscResource.Common\0.24.0\DscResource.Common.psm1
- Modules\DscResource.Common\0.24.0\DscResource.Common.psm1
- Modules\Viscalyx.Common\0.7.0\Modules\DscResource.Common\0.24.0\en-US\DscResource.Common-help.xml
- Modules\Viscalyx.Common\0.7.0\Viscalyx.Common.psm1
- Modules\Viscalyx.Common\0.7.0\Modules\DscResource.Common\0.24.0\en-US\about_DscResource.Common.help.txt
- Modules\Viscalyx.Common\0.7.0\Viscalyx.Common.psd1
- Modules\Viscalyx.Common\0.7.0\Modules\DscResource.Common\0.24.0\en-US\DscResource.Common.strings.psd1
- Modules\DscResource.Common\0.24.0\en-US\DscResource.Common-help.xml
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.2.1 | 5 | 12/15/2025 |
| 1.2.1-previe... | 3 | 12/15/2025 |
| 1.2.0 | 8 | 10/4/2025 |
| 1.1.1-previe... (current version) | 3 | 10/4/2025 |
| 1.1.0 | 5 | 10/3/2025 |
| 1.1.0-previe... | 3 | 10/3/2025 |
| 1.0.0 | 14 | 2/4/2025 |
| 0.1.1-previe... | 4 | 2/4/2025 |
| 0.1.1-previe... | 4 | 2/2/2025 |
| 0.1.1-previe... | 4 | 2/2/2025 |
| 0.1.1-previe... | 68 | 8/26/2024 |
| 0.1.1-previe... | 55 | 8/22/2024 |
| 0.1.0-previe... | 5 | 8/20/2024 |