tests/Unit.Tests.ps1
$script:ModuleName = 'VSCodeBackup' # Removes all versions of the module from the session before importing Get-Module $ModuleName | Remove-Module $ModuleBase = Split-Path -Parent $MyInvocation.MyCommand.Path # For tests in .\Tests subdirectory if ((Split-Path $ModuleBase -Leaf) -eq 'Tests') { $ModuleBase = Split-Path $ModuleBase -Parent } ## this variable is for the VSTS tasks and is to be used for refernecing any mock artifacts $Env:ModuleBase = $ModuleBase Import-Module $ModuleBase\$ModuleName.psd1 -PassThru -ErrorAction Stop | Out-Null Describe "Basic function unit tests" -Tags Build , Unit{ } |