-
I just started writing tests for my new resources which make server level changes. The first test has the following steps:
- Backup IIS Config
- Using the dsc resource to change a value
- Check that t…
-
Consider the following files which demonstrate asserting that Write-Error was called only once with a particular parameter and _not otherwise_. I find this to be a common scenario for testing basic v…
alx9r updated
9 years ago
-
When using `should` to assert values, the data type is not checked leading to false test results.
# False Negative
```
Describe -Tags "Error in Comparisons" "Tests that should fail, but succeed" {
…
-
I do a lot of critical setup operations for my tests in BeforeEach/BeforeAll blocks. What I'm noticing is that if something fails in BeforeEach/BeforeAll that it will continue to run all of the "It" t…
-
I feel like I'm just doing something stupid here but this seems like it should work. I have been unable to get a standalone repro and it only reproduces when using a specific set of cmdlets -- I don't…
-
Repro script
``` Powershell
Describe 'Test' {
It 'Test a Throw 1' {
$o = new-object psobject
$o | Add-Member -MemberType ScriptMethod -Name 'Test' -Value {
throw (new-…
-
``` javascript
try { throw new Error("A pig ate everyone at 8:12"); }
finally { print("*munch*"); }
```
The `finally` runs, but leads to "internal error in bytecode executor longjmp handler". What's…
-
The following code demonstrates that the parameters that are available to `Assert-MockCalled -ParameterFilter` are in the state they become _after_ the execution of the `-MockWith`. This is surprisin…
alx9r updated
9 years ago
-
I've been writing idempotent functions which would become the building-blocks of DSC resources. The following code demonstrates a prototypical module and test fixture.
## Module.psm1
``` Powershell
…
alx9r updated
9 years ago
-
The code in lines 11-13 of `PesterThrow.ps1` (https://github.com/pester/Pester/blob/Beta/Functions/Assertions/PesterThrow.ps1#L11-L13) fails to redirect output to `$null` when testing PowerShell DSC e…