@@ -29,8 +29,8 @@ describe("UpdatePowerShell feature", function () {
29
29
settings . promptToUpdatePowerShell = false ;
30
30
const version : IPowerShellVersionDetails = {
31
31
"version" : "7.3.0" ,
32
- "displayVersion" : "7.3" ,
33
32
"edition" : "Core" ,
33
+ "commit" : "7.3.0" ,
34
34
"architecture" : "X64"
35
35
} ;
36
36
// @ts -expect-error testing doesn't require all arguments.
@@ -41,10 +41,9 @@ describe("UpdatePowerShell feature", function () {
41
41
42
42
it ( "Won't check for Windows PowerShell" , function ( ) {
43
43
const version : IPowerShellVersionDetails = {
44
- // TODO: This should handle e.g. 5.1.22621.436
45
- "version" : "5.1.0" ,
46
- "displayVersion" : "5.1" ,
44
+ "version" : "5.1.22621" ,
47
45
"edition" : "Desktop" ,
46
+ "commit" : "5.1.22621" ,
48
47
"architecture" : "X64"
49
48
} ;
50
49
// @ts -expect-error testing doesn't require all arguments.
@@ -53,12 +52,38 @@ describe("UpdatePowerShell feature", function () {
53
52
assert ( ! updater . shouldCheckForUpdate ( ) ) ;
54
53
} ) ;
55
54
55
+ it ( "Won't check for a development build of PowerShell" , function ( ) {
56
+ const version : IPowerShellVersionDetails = {
57
+ "version" : "7.3.0-preview.3" ,
58
+ "edition" : "Core" ,
59
+ "commit" : "7.3.0-preview.3-508-g07175ae0ff8eb7306fe0b0fc7d19bdef4fbf2d67" ,
60
+ "architecture" : "Arm64"
61
+ } ;
62
+ // @ts -expect-error testing doesn't require all arguments.
63
+ const updater = new UpdatePowerShell ( undefined , settings , testLogger , version ) ;
64
+ // @ts -expect-error method is private.
65
+ assert ( ! updater . shouldCheckForUpdate ( ) ) ;
66
+ } ) ;
67
+
68
+ it ( "Won't check for a daily build of PowerShell" , function ( ) {
69
+ const version : IPowerShellVersionDetails = {
70
+ "version" : "7.3.0-daily20221206.1" ,
71
+ "edition" : "Core" ,
72
+ "commit" : "7.3.0-daily20221206.1" ,
73
+ "architecture" : "Arm64"
74
+ } ;
75
+ // @ts -expect-error testing doesn't require all arguments.
76
+ const updater = new UpdatePowerShell ( undefined , settings , testLogger , version ) ;
77
+ // @ts -expect-error method is private.
78
+ assert ( ! updater . shouldCheckForUpdate ( ) ) ;
79
+ } ) ;
80
+
56
81
it ( "Won't check if POWERSHELL_UPDATECHECK is 'Off'" , function ( ) {
57
82
process . env . POWERSHELL_UPDATECHECK = "Off" ;
58
83
const version : IPowerShellVersionDetails = {
59
84
"version" : "7.3.0" ,
60
- "displayVersion" : "7.3" ,
61
85
"edition" : "Core" ,
86
+ "commit" : "7.3.0" ,
62
87
"architecture" : "X64"
63
88
} ;
64
89
// @ts -expect-error testing doesn't require all arguments.
@@ -70,8 +95,8 @@ describe("UpdatePowerShell feature", function () {
70
95
it ( "Should otherwise check to update PowerShell" , function ( ) {
71
96
const version : IPowerShellVersionDetails = {
72
97
"version" : "7.3.0" ,
73
- "displayVersion" : "7.3" ,
74
98
"edition" : "Core" ,
99
+ "commit" : "7.3.0" ,
75
100
"architecture" : "X64"
76
101
} ;
77
102
// @ts -expect-error testing doesn't require all arguments.
@@ -86,8 +111,8 @@ describe("UpdatePowerShell feature", function () {
86
111
process . env . POWERSHELL_UPDATECHECK = "LTS" ;
87
112
const version : IPowerShellVersionDetails = {
88
113
"version" : "7.0.0" ,
89
- "displayVersion" : "7.0" ,
90
114
"edition" : "Core" ,
115
+ "commit" : "7.0.0" ,
91
116
"architecture" : "X64"
92
117
} ;
93
118
// @ts -expect-error testing doesn't require all arguments.
@@ -101,8 +126,8 @@ describe("UpdatePowerShell feature", function () {
101
126
it ( "Would update to stable" , async function ( ) {
102
127
const version : IPowerShellVersionDetails = {
103
128
"version" : "7.0.0" ,
104
- "displayVersion" : "7.0" ,
105
129
"edition" : "Core" ,
130
+ "commit" : "7.0.0" ,
106
131
"architecture" : "X64"
107
132
} ;
108
133
// @ts -expect-error testing doesn't require all arguments.
0 commit comments