-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.ps1
More file actions
34 lines (28 loc) · 939 Bytes
/
test.ps1
File metadata and controls
34 lines (28 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<#
.SYNOPSIS
Run tests
.DESCRIPTION
Run the unit test of the actual module
.NOTES
Using TestingHelper this script will search for a Test module and run the tests
This script will be referenced from launch.json to run the tests on VSCode
.LINK
https://raw.githubusercontent.com/rulasg/StagingModule/main/test.ps1
.EXAMPLE
> ./test.ps1
#>
[CmdletBinding()]
param (
[Parameter()][switch]$ShowTestErrors,
[Parameter()][string]$TestName
)
# Load Test_Helper module
Import-Module ./tools/Test_Helper
# Install and load TestingHelper
Import-RequiredModule "TestingHelper" -AllowPrerelease
# Install and Load Module dependencies
Get-RequiredModule | Import-RequiredModule -AllowPrerelease
# Resolve scoped tests
$TestName = [string]::IsNullOrWhiteSpace($TestName) ? $global:TestNameVar : $TestName
# Call TestingHelper to run the tests
Invoke-TestingHelper -TestName $TestName -ShowTestErrors:$ShowTestErrors