New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$TestDrive does not work in v5.0.2 #1620
Comments
This guide is for version 4.x only and outdated with version 5.0. There were some braking changes implemented with 5.0. Please see https://github.com/pester/Pester#discovery--run in particular. Edit: If you need some code for all tests, put it into "BeforeAll" or "BeforeEach". |
Thank you very much! That solved my issue! |
Strugling a bit with this too. In the old Pester I had a structure like this: Describe 'send an error mail to tha admin when' {
In $testDrive {
Context 'when things go wrong {
it 'gets tested' { How is something like this translated to the new Pester? I can't seem to get it right and there's no example on the page. |
As you can see "In" executes a script from a given path. That means you got code outside your "It" block -> bad.
|
1. General summary of the issue
The examples on https://pester.dev/docs/usage/testdrive how to use
$TestDrive
does not work in v5.0.2, anymore! But, in v4.7.3 everything works as described.2. Describe Your Environment
PowerShell version: 5.1.19640.1
OS version: Microsoft Windows NT 10.0.19640.1
3. Expected Behavior
The
$TestDrive
feature should work again.4.Current Behavior
Repro:
5. Possible Solution
Downgrade Pester to v4.7.3.
The text was updated successfully, but these errors were encountered: