@@ -40,6 +40,7 @@ describe('installer tests', () => {
4040 it ( 'should throw the error in case of non-zero exit code of the installation script. The error message should contain logs.' , async ( ) => {
4141 const inputVersion = '10.0.101' ;
4242 const inputQuality = '' as QualityOptions ;
43+ const inputVerbose = false ;
4344 const errorMessage = 'fictitious error message!' ;
4445
4546 getExecOutputSpy . mockImplementation ( ( ) => {
@@ -52,7 +53,8 @@ describe('installer tests', () => {
5253
5354 const dotnetInstaller = new installer . DotnetCoreInstaller (
5455 inputVersion ,
55- inputQuality
56+ inputQuality ,
57+ inputVerbose
5658 ) ;
5759 await expect ( dotnetInstaller . installDotnet ( ) ) . rejects . toThrow (
5860 `Failed to install dotnet, exit code: 1. ${ errorMessage } `
@@ -62,6 +64,7 @@ describe('installer tests', () => {
6264 it ( 'should return version of .NET SDK after installation complete' , async ( ) => {
6365 const inputVersion = '10.0.101' ;
6466 const inputQuality = '' as QualityOptions ;
67+ const inputVerbose = false ;
6568 const stdout = `Fictitious dotnet version ${ inputVersion } is installed` ;
6669 getExecOutputSpy . mockImplementation ( ( ) => {
6770 return Promise . resolve ( {
@@ -74,7 +77,8 @@ describe('installer tests', () => {
7477
7578 const dotnetInstaller = new installer . DotnetCoreInstaller (
7679 inputVersion ,
77- inputQuality
80+ inputQuality ,
81+ inputVerbose
7882 ) ;
7983 const installedVersion = await dotnetInstaller . installDotnet ( ) ;
8084
@@ -84,6 +88,7 @@ describe('installer tests', () => {
8488 it ( `should supply 'version' argument to the installation script if supplied version is in A.B.C syntax` , async ( ) => {
8589 const inputVersion = '10.0.101' ;
8690 const inputQuality = '' as QualityOptions ;
91+ const inputVerbose = false ;
8792 const stdout = `Fictitious dotnet version ${ inputVersion } is installed` ;
8893
8994 getExecOutputSpy . mockImplementation ( ( ) => {
@@ -97,7 +102,8 @@ describe('installer tests', () => {
97102
98103 const dotnetInstaller = new installer . DotnetCoreInstaller (
99104 inputVersion ,
100- inputQuality
105+ inputQuality ,
106+ inputVerbose
101107 ) ;
102108
103109 await dotnetInstaller . installDotnet ( ) ;
@@ -122,6 +128,7 @@ describe('installer tests', () => {
122128 it ( `should warn if the 'quality' input is set and the supplied version is in A.B.C syntax` , async ( ) => {
123129 const inputVersion = '10.0.101' ;
124130 const inputQuality = 'ga' as QualityOptions ;
131+ const inputVerbose = false ;
125132 const stdout = `Fictitious dotnet version ${ inputVersion } is installed` ;
126133 getExecOutputSpy . mockImplementation ( ( ) => {
127134 return Promise . resolve ( {
@@ -134,7 +141,8 @@ describe('installer tests', () => {
134141
135142 const dotnetInstaller = new installer . DotnetCoreInstaller (
136143 inputVersion ,
137- inputQuality
144+ inputQuality ,
145+ inputVerbose
138146 ) ;
139147
140148 await dotnetInstaller . installDotnet ( ) ;
@@ -147,6 +155,7 @@ describe('installer tests', () => {
147155 it ( `should warn if the 'quality' input is set and version isn't in A.B.C syntax but major tag is lower then 6` , async ( ) => {
148156 const inputVersion = '3.1' ;
149157 const inputQuality = 'ga' as QualityOptions ;
158+ const inputVerbose = false ;
150159 const stdout = `Fictitious dotnet version ${ inputVersion } is installed` ;
151160
152161 getExecOutputSpy . mockImplementation ( ( ) => {
@@ -160,7 +169,8 @@ describe('installer tests', () => {
160169
161170 const dotnetInstaller = new installer . DotnetCoreInstaller (
162171 inputVersion ,
163- inputQuality
172+ inputQuality ,
173+ inputVerbose
164174 ) ;
165175
166176 await dotnetInstaller . installDotnet ( ) ;
@@ -174,6 +184,7 @@ describe('installer tests', () => {
174184 `should supply 'quality' argument to the installation script if quality input is set and version (%s) is not in A.B.C syntax` ,
175185 async inputVersion => {
176186 const inputQuality = 'ga' as QualityOptions ;
187+ const inputVerbose = false ;
177188 const exitCode = 0 ;
178189 const stdout = `Fictitious dotnet version ${ inputVersion } is installed` ;
179190 getExecOutputSpy . mockImplementation ( ( ) => {
@@ -187,7 +198,8 @@ describe('installer tests', () => {
187198
188199 const dotnetInstaller = new installer . DotnetCoreInstaller (
189200 inputVersion ,
190- inputQuality
201+ inputQuality ,
202+ inputVerbose
191203 ) ;
192204
193205 await dotnetInstaller . installDotnet ( ) ;
@@ -214,6 +226,7 @@ describe('installer tests', () => {
214226 `should supply 'channel' argument to the installation script if version (%s) isn't in A.B.C syntax` ,
215227 async inputVersion => {
216228 const inputQuality = '' as QualityOptions ;
229+ const inputVerbose = false ;
217230 const exitCode = 0 ;
218231 const stdout = `Fictitious dotnet version ${ inputVersion } is installed` ;
219232 getExecOutputSpy . mockImplementation ( ( ) => {
@@ -227,7 +240,8 @@ describe('installer tests', () => {
227240
228241 const dotnetInstaller = new installer . DotnetCoreInstaller (
229242 inputVersion ,
230- inputQuality
243+ inputQuality ,
244+ inputVerbose
231245 ) ;
232246
233247 await dotnetInstaller . installDotnet ( ) ;
@@ -250,11 +264,44 @@ describe('installer tests', () => {
250264 }
251265 ) ;
252266
267+ it ( `should supply 'verbose' argument to the installation script if verbose input is set` , async ( ) => {
268+ const inputVersion = '10.0.101' ;
269+ const inputQuality = '' as QualityOptions ;
270+ const inputVerbose = true ;
271+ const stdout = `Fictitious dotnet version ${ inputVersion } is installed` ;
272+
273+ getExecOutputSpy . mockImplementation ( ( ) => {
274+ return Promise . resolve ( {
275+ exitCode : 0 ,
276+ stdout : `${ stdout } ` ,
277+ stderr : ''
278+ } ) ;
279+ } ) ;
280+ maxSatisfyingSpy . mockImplementation ( ( ) => inputVersion ) ;
281+
282+ const dotnetInstaller = new installer . DotnetCoreInstaller (
283+ inputVersion ,
284+ inputQuality ,
285+ inputVerbose
286+ ) ;
287+
288+ await dotnetInstaller . installDotnet ( ) ;
289+
290+ const scriptArguments = getExecOutputSpy . mock . calls . map ( call =>
291+ ( call [ 1 ] as string [ ] ) . join ( ' ' )
292+ ) ;
293+ const expectedArgument = IS_WINDOWS ? '-Verbose' : '--verbose' ;
294+
295+ expect ( scriptArguments [ 0 ] ) . toContain ( expectedArgument ) ;
296+ expect ( scriptArguments [ 1 ] ) . toContain ( expectedArgument ) ;
297+ } ) ;
298+
253299 if ( IS_WINDOWS ) {
254300 it ( `should supply '-ProxyAddress' argument to the installation script if env.variable 'https_proxy' is set` , async ( ) => {
255301 process . env [ 'https_proxy' ] = 'https://proxy.com' ;
256302 const inputVersion = '10.0.101' ;
257303 const inputQuality = '' as QualityOptions ;
304+ const inputVerbose = false ;
258305 const stdout = `Fictitious dotnet version ${ inputVersion } is installed` ;
259306
260307 getExecOutputSpy . mockImplementation ( ( ) => {
@@ -268,7 +315,8 @@ describe('installer tests', () => {
268315
269316 const dotnetInstaller = new installer . DotnetCoreInstaller (
270317 inputVersion ,
271- inputQuality
318+ inputQuality ,
319+ inputVerbose
272320 ) ;
273321
274322 await dotnetInstaller . installDotnet ( ) ;
@@ -293,6 +341,7 @@ describe('installer tests', () => {
293341 process . env [ 'no_proxy' ] = 'first.url,second.url' ;
294342 const inputVersion = '10.0.101' ;
295343 const inputQuality = '' as QualityOptions ;
344+ const inputVerbose = false ;
296345 const stdout = `Fictitious dotnet version ${ inputVersion } is installed` ;
297346
298347 getExecOutputSpy . mockImplementation ( ( ) => {
@@ -306,7 +355,8 @@ describe('installer tests', () => {
306355
307356 const dotnetInstaller = new installer . DotnetCoreInstaller (
308357 inputVersion ,
309- inputQuality
358+ inputQuality ,
359+ inputVerbose
310360 ) ;
311361
312362 await dotnetInstaller . installDotnet ( ) ;
0 commit comments