-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathExtension.Tests.ps1
50 lines (41 loc) · 1.32 KB
/
Extension.Tests.ps1
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# Extension unit tests
#
[CmdletBinding()]
param ()
BeforeAll {
# Setup error handling
$ErrorActionPreference = 'Stop';
Set-StrictMode -Version latest;
if ($Env:SYSTEM_DEBUG -eq 'true') {
$VerbosePreference = 'Continue';
}
# Setup tests paths
$rootPath = $PWD;
$extensionOut = Join-Path -Path $rootPath -ChildPath 'out/dist/'
$here = (Resolve-Path $PSScriptRoot).Path;
$outputPath = Join-Path -Path $rootPath -ChildPath out/tests/PSRule.Tests/Common;
Remove-Item -Path $outputPath -Force -Recurse -Confirm:$False -ErrorAction Ignore;
$Null = New-Item -Path $outputPath -ItemType Directory -Force;
Import-Module -Name VstsTaskSdk -ArgumentList @{ 'NonInteractive' = 'true' };
}
Describe 'Extension V2' {
BeforeAll {
$entryPointPath = (Join-Path -Path $extensionOut -ChildPath 'ps-rule-assert/ps-rule-assertV2/powershell.ps1');
}
Context 'With defaults' {
It 'Runs entrypoint' {
$taskOptions = @{
Path = ''
InputType = 'repository'
InputPath = ''
Source = '.ps-rule/'
Modules = ''
Baseline = ''
}
. $entryPointPath @taskOptions;
}
}
}