plastikfan / Plastiks

My own PowerShell Plasters
MIT License
0 stars 0 forks source link

Migrate tests to Pester v5 #1

Open plastikfan opened 4 years ago

plastikfan commented 4 years ago

The tests are using a format not supported in Pester V5. The type of errors you see are as follows:

[+] C:\Users\Plastikfan\dev\temp\Yoric\Elizium.Yoric\Tests\Add-Bone.tests.ps1 40ms (3ms|34ms)
Should: C:\Users\Plastikfan\dev\temp\Yoric\Elizium.Yoric\Tests\Elizium.Yoric.tests.ps1:18
Line |
  18 |          $errors.Count | Should Be 0
     |                          ~~~~~~~~~~~
     | Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4

Should: C:\Users\Plastikfan\dev\temp\Yoric\Elizium.Yoric\Tests\Elizium.Yoric.tests.ps1:18
Line |
  18 |          $errors.Count | Should Be 0
     |                          ~~~~~~~~~~~
     | The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that
     | take pipeline input.

branch: pester-v5

plastikfan commented 4 years ago

The following warning message needs to be addressed:

WARNING: You are using Legacy parameter set that adapts Pester 5 syntax to Pester 4 syntax. This parameter set is deprecated, and does not work 100%. The -Strict and -PesterOption parameters are ignored, and providing advanced configuration to -Path (-Script), and -CodeCoverage via a hash table does not work. Please refer to https://github.com/pester/Pester/releases/tag/5.0.1#legacy-parameter-set for more information.

plastikfan commented 4 years ago

Resolved by information in https://github.com/pester/Pester/issues/1218