@@ -28,7 +28,11 @@ describe('windows toolchain installation verification', () => {
28
28
catalog : { productDisplayVersion : '17' } ,
29
29
properties : {
30
30
setupEngineFilePath : path . join ( 'C:' , 'Visual Studio' , 'setup.exe' )
31
- }
31
+ } ,
32
+ components : [
33
+ 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' ,
34
+ 'Microsoft.VisualStudio.Component.Windows11SDK.22621'
35
+ ]
32
36
} )
33
37
const vsEnvs = [
34
38
`UniversalCRTSdkDir=${ path . join ( 'C:' , 'Windows Kits' ) } ` ,
@@ -46,16 +50,19 @@ describe('windows toolchain installation verification', () => {
46
50
} )
47
51
48
52
it ( 'tests adding additional components' , async ( ) => {
53
+ jest . spyOn ( os , 'release' ) . mockReturnValue ( '10.0.17063' )
49
54
jest
50
55
. spyOn ( core , 'getInput' )
51
56
. mockReturnValue (
52
57
'Microsoft.VisualStudio.Component.VC.ATL;Microsoft.VisualStudio.Component.VC.CMake.Project;Microsoft.VisualStudio.Component.Windows10SDK'
53
58
)
54
59
const installer = new WindowsToolchainInstaller ( toolchain )
55
- expect ( installer [ 'vsRequirement' ] . components . slice ( 2 ) ) . toStrictEqual ( [
60
+ expect ( installer [ 'vsRequirement' ] . components ) . toStrictEqual ( [
61
+ 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' ,
56
62
'Microsoft.VisualStudio.Component.VC.ATL' ,
57
63
'Microsoft.VisualStudio.Component.VC.CMake.Project' ,
58
- 'Microsoft.VisualStudio.Component.Windows10SDK'
64
+ 'Microsoft.VisualStudio.Component.Windows10SDK' ,
65
+ 'Microsoft.VisualStudio.Component.Windows10SDK.17763'
59
66
] )
60
67
} )
61
68
@@ -77,6 +84,18 @@ describe('windows toolchain installation verification', () => {
77
84
] )
78
85
} )
79
86
87
+ it ( 'tests setting up on Windows 11 with custom SDK' , async ( ) => {
88
+ jest . spyOn ( os , 'release' ) . mockReturnValue ( '10.0.26100' )
89
+ jest
90
+ . spyOn ( core , 'getInput' )
91
+ . mockReturnValue ( 'Microsoft.VisualStudio.Component.Windows11SDK.22621' )
92
+ const installer = new WindowsToolchainInstaller ( toolchain )
93
+ expect ( installer [ 'vsRequirement' ] . components ) . toStrictEqual ( [
94
+ 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' ,
95
+ 'Microsoft.VisualStudio.Component.Windows11SDK.22621'
96
+ ] )
97
+ } )
98
+
80
99
it ( 'tests download without caching' , async ( ) => {
81
100
const installer = new WindowsToolchainInstaller ( toolchain )
82
101
expect ( installer [ 'version' ] ) . toStrictEqual ( parseSemVer ( '5.8' ) )
@@ -181,7 +200,7 @@ describe('windows toolchain installation verification', () => {
181
200
. mockResolvedValue ( )
182
201
await installer [ 'add' ] ( '' )
183
202
expect ( setupSpy ) . toHaveBeenCalled ( )
184
- expect ( updateSpy ) . toHaveBeenCalledWith ( 'root' , true )
203
+ expect ( updateSpy ) . toHaveBeenCalledWith ( 'root' )
185
204
} )
186
205
187
206
it ( 'tests unpack for failed path matching without additional module setup' , async ( ) => {
@@ -231,7 +250,7 @@ describe('windows toolchain installation verification', () => {
231
250
. mockResolvedValue ( )
232
251
await installer [ 'add' ] ( '' )
233
252
expect ( setupSpy ) . toHaveBeenCalled ( )
234
- expect ( updateSpy ) . toHaveBeenCalledWith ( 'root' , false )
253
+ expect ( updateSpy ) . toHaveBeenCalledWith ( 'root' )
235
254
} )
236
255
237
256
it ( 'tests add to PATH' , async ( ) => {
0 commit comments