@@ -29,8 +29,8 @@ describe("UpdatePowerShell feature", function () {
2929 settings . promptToUpdatePowerShell = false ;
3030 const version : IPowerShellVersionDetails = {
3131 "version" : "7.3.0" ,
32- "displayVersion" : "7.3" ,
3332 "edition" : "Core" ,
33+ "commit" : "7.3.0" ,
3434 "architecture" : "X64"
3535 } ;
3636 // @ts -expect-error testing doesn't require all arguments.
@@ -41,10 +41,9 @@ describe("UpdatePowerShell feature", function () {
4141
4242 it ( "Won't check for Windows PowerShell" , function ( ) {
4343 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" ,
4745 "edition" : "Desktop" ,
46+ "commit" : "5.1.22621" ,
4847 "architecture" : "X64"
4948 } ;
5049 // @ts -expect-error testing doesn't require all arguments.
@@ -53,12 +52,38 @@ describe("UpdatePowerShell feature", function () {
5352 assert ( ! updater . shouldCheckForUpdate ( ) ) ;
5453 } ) ;
5554
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+
5681 it ( "Won't check if POWERSHELL_UPDATECHECK is 'Off'" , function ( ) {
5782 process . env . POWERSHELL_UPDATECHECK = "Off" ;
5883 const version : IPowerShellVersionDetails = {
5984 "version" : "7.3.0" ,
60- "displayVersion" : "7.3" ,
6185 "edition" : "Core" ,
86+ "commit" : "7.3.0" ,
6287 "architecture" : "X64"
6388 } ;
6489 // @ts -expect-error testing doesn't require all arguments.
@@ -70,8 +95,8 @@ describe("UpdatePowerShell feature", function () {
7095 it ( "Should otherwise check to update PowerShell" , function ( ) {
7196 const version : IPowerShellVersionDetails = {
7297 "version" : "7.3.0" ,
73- "displayVersion" : "7.3" ,
7498 "edition" : "Core" ,
99+ "commit" : "7.3.0" ,
75100 "architecture" : "X64"
76101 } ;
77102 // @ts -expect-error testing doesn't require all arguments.
@@ -86,8 +111,8 @@ describe("UpdatePowerShell feature", function () {
86111 process . env . POWERSHELL_UPDATECHECK = "LTS" ;
87112 const version : IPowerShellVersionDetails = {
88113 "version" : "7.0.0" ,
89- "displayVersion" : "7.0" ,
90114 "edition" : "Core" ,
115+ "commit" : "7.0.0" ,
91116 "architecture" : "X64"
92117 } ;
93118 // @ts -expect-error testing doesn't require all arguments.
@@ -101,8 +126,8 @@ describe("UpdatePowerShell feature", function () {
101126 it ( "Would update to stable" , async function ( ) {
102127 const version : IPowerShellVersionDetails = {
103128 "version" : "7.0.0" ,
104- "displayVersion" : "7.0" ,
105129 "edition" : "Core" ,
130+ "commit" : "7.0.0" ,
106131 "architecture" : "X64"
107132 } ;
108133 // @ts -expect-error testing doesn't require all arguments.
0 commit comments