This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
conditional tests / selective tests - bad title :) #27
Open
Description
I get that having logical comparisons in typical unit tests isn't a good idea,
ie a totally crappy example:
if ($name.StartsWith("blahblahblah")) {
it "something" {
$name | should match "blah*"
}
}
else {
it "blah" {
$name | should match "foo*"
}
}
which I could also do with a single regex ie: blah.|foo. - however this would allow for wrong 'combinations'
but I have specific whole comprehensive tests that I dont want to run in a cloud based test but do in a on prem test and I also have the odd test where I expect different results based on the name of the machine. I also want to use the same set (module) of tests..
Thoughts on how to do this?
- conditional logical
- conditional logic by means of a function to do the verification which has its own tests?
- Name the tests and then only execute tests with a specific naming convention?
Thanks
David