The below script works when ran with a dot but fail to run when called with invoke-pester (running Pester version 4.6.0). Am I doing something wrong or is there an issue with invoke-pester?
using module "./Test.psm1"
Describe "Unit Test" -Tag 'Unit' {
Context 'test' {
It 'return' {
mock Write-Verbose { write-host $Message }
$T = [Test]::new()
$T.createoutput()
assert-MockCalled Write-Verbose
}
}
}
Test.psm1:
class Test{
[void]createoutput(){
Write-Verbose 'hello'
}
}