powershell - Where does Pester's Invoke-Pester reside? -


according this documentation should possible measure code coverage using pester.

ps c:\path\to\codecoverage> invoke-pester .\coveragetest.tests.ps1 -codecoverage .\coveragetest.ps1  invoke-pester : term 'invoke-pester' not recognized name of cmdlet, function, script file, or operable program. check spelling of name, or if path included, verify path correct , try again. @ line:1 char:1 + invoke-pester .\coveragetest.tests.ps1 -codecoverage .\coveragetest.ps1 + ~~~~~~~~~~~~~     + categoryinfo          : objectnotfound: (invoke-pester:string) [], commandnotfoundexception     + fullyqualifiederrorid : commandnotfoundexception 

after reading this documentation clear pester module needs imported before running invoke-pester

ps c:\path\to\codecoverage> import-module "c:\programdata\chocolatey\lib\pester.3.1.1\tools\pester.psm1" ps c:\path\to\codecoverage> invoke-pester .\coveragetest.tests.ps1 -codecoverage .\coveragetest.ps1 executing tests in 'c:\users\r\desktop\codecoverage\coveragetest.tests.ps1' describing demonstrating code coverage  [+] calls functionone no switch parameter set 1.8s  [+] calls functiontwo 287ms tests completed in 2.09s passed: 2 failed: 0 skipped: 0 pending: 0  code coverage report: covered 60.00 % of 5 analyzed commands in 1 file.  missed commands:  file             function    line command ----             --------    ---- ------- coveragetest.ps1 functionone    5 return 'switchparam set' coveragetest.ps1 functiontwo   16 return 'i not' 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -