Skip to content

Commit 9ca2eaf

Browse files
committed
fix(test): fix preamble of PSDepend.Test
1 parent e082199 commit 9ca2eaf

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

Tests/PSDepend.Tests.ps1

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
1+
if(-not $ENV:BHProjectPath)
2+
{
3+
Set-BuildEnvironment -Path $PSScriptRoot\..
4+
}
5+
Remove-Module $ENV:BHProjectName -ErrorAction SilentlyContinue
6+
Import-Module (Join-Path $ENV:BHProjectPath $ENV:BHProjectName) -Force
17

2-
BeforeAll {
8+
$PSVersion = $PSVersionTable.PSVersion.Major
39

4-
if(-not $ENV:BHProjectPath)
10+
# Verbose output for non-master builds on appveyor
11+
# Handy for troubleshooting.
12+
# Splat @Verbose against commands as needed (here or in pester tests)
13+
$Verbose = @{}
14+
if($ENV:BHBranchName -notlike "master" -or $env:BHCommitMessage -match "!verbose")
515
{
6-
Set-BuildEnvironment -Path $PSScriptRoot\..
16+
$Verbose.add("Verbose",$True)
717
}
8-
Remove-Module $ENV:BHProjectName -ErrorAction SilentlyContinue
9-
Import-Module (Join-Path $ENV:BHProjectPath $ENV:BHProjectName) -Force
10-
11-
$PSVersion = $PSVersionTable.PSVersion.Major
1218

13-
# Verbose output for non-master builds on appveyor
14-
# Handy for troubleshooting.
15-
# Splat @Verbose against commands as needed (here or in pester tests)
16-
$Verbose = @{}
17-
if($ENV:BHBranchName -notlike "master" -or $env:BHCommitMessage -match "!verbose")
18-
{
19-
$Verbose.add("Verbose",$True)
20-
}
21-
22-
$TestDepends = Join-Path $ENV:BHProjectPath Tests\DependFiles
23-
}
19+
$TestDepends = Join-Path $ENV:BHProjectPath Tests\DependFiles
2420

2521
Describe "$ENV:BHProjectName PS$PSVersion" {
2622
Context 'Strict mode' {

0 commit comments

Comments
 (0)