microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
63dce6b8a5ec2b25b203f52f4fe376f352ea51f4

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

eng/common/scripts/Analyze-Changes.Tests.ps1

60lines · modecode

1BeforeAll {
2 . $PSScriptRoot/Analyze-Changes.ps1 *>&1 | Out-Null
3}
4
5Describe 'Analyze-Changes' {
6 AfterEach {
7 foreach($package in $isolatedPackages.Values) {
8 $package.RunValue = $false;
9 }
10 }
11
12 It 'Should return package variables if package specific changes are detected' {
13 $actual = Get-ActiveVariables @(
14 "packages/http-client-csharp/src/constants.ts"
15 )
16
17 $expected = @('RunCSharp')
18
19 $actual | ForEach-Object {
20 $_ | Should -BeIn $expected
21 }
22 }
23
24 It 'Should return RunCore if common files are changed' {
25 $actual = Get-ActiveVariables @(
26 "packages/compiler/package.json"
27 )
28
29 $expected = @('RunCore')
30
31 $actual | ForEach-Object {
32 $_ | Should -BeIn $expected
33 }
34 }
35
36 It 'Should return a combination of core and isolated packages' {
37 $actual = Get-ActiveVariables @(
38 "packages/http-client-csharp/src/constants.ts",
39 "packages/compiler/package.json"
40 )
41
42 $expected = @('RunCore', 'RunCSharp')
43
44 $actual | ForEach-Object {
45 $_ | Should -BeIn $expected
46 }
47 }
48
49 It 'Should return RunCSharp and RunCore if .editorconfig is changed' {
50 $actual = Get-ActiveVariables @(
51 ".editorconfig"
52 )
53
54 $expected = @('RunCore', 'RunCSharp')
55
56 $actual | ForEach-Object {
57 $_ | Should -BeIn $expected
58 }
59 }
60}
61