Skip to content

Instantly share code, notes, and snippets.

@ninmonkey
Last active November 9, 2022 21:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninmonkey/bea8f60bcc271c8155f610d2b9c83bcd to your computer and use it in GitHub Desktop.
Save ninmonkey/bea8f60bcc271c8155f610d2b9c83bcd to your computer and use it in GitHub Desktop.
Pester5 Foreach-Loop snippet.json
{
// to use snippets, see: https://code.visualstudio.com/docs/editor/userdefinedsnippets
// The monkey makes it easier to find in menus
"Pester ⇢ ForEach Data 🐒": {
"prefix": "pestForEach 🐒 Test Data",
"body": [
"It '\"<${1:Name}>\" Returns \"<expected>\"' -ForEach @(",
" @{ ${1:Name} = ${2:x} ; Expected = ${3:y} }",
") {",
" ${0:YourFunction} -${1:Name} \\$${1:Name} | Should -Be \\$Expected",
"}"
],
"description": "template for data-driven test"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment