If I have some code in the Context for setup purposes that fails, it would be great if the project would consider one of the two strategies below:
- Consider failing each
It assertion/test with the same exception.
- Only report one error (relaying the fact that an error in the context setup failed)
Thoughts?
Example:
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "SomeDescribe" {
Context "When some Context runs and an error happens" {
throw "some error during setup"
It "Should report something" {
# This test should not even run (but possibly fail with the error from the context setup)
}
It "Should report something else" {
# This test should not even run (but possibly fail with the error from the context setup)
}
}
}
If I have some code in the
Contextfor setup purposes that fails, it would be great if the project would consider one of the two strategies below:Itassertion/test with the same exception.Thoughts?
Example: