@@ -35,7 +35,6 @@ test.before(() => {
35
35
test . beforeEach ( async ( t ) => {
36
36
const sinon = t . context . sinon = sinonGlobal . createSandbox ( ) ;
37
37
t . context . processStderrWriteStub = sinon . stub ( process . stderr , "write" ) ;
38
- t . context . consoleInfoStub = sinon . stub ( console , "info" ) ;
39
38
t . context . originalArgv = process . argv ;
40
39
process . env . UI5_CLI_TEST_BIN_RUN_MAIN = "false" ; // prevent automatic execution of main function
41
40
@@ -77,7 +76,7 @@ test.serial("checkRequirements: Using supported Node.js version", (t) => {
77
76
} ) ;
78
77
79
78
t . true ( returnValue ) ;
80
- t . is ( processStderrWriteStub . callCount , 0 , "console.log should not be called " ) ;
79
+ t . is ( processStderrWriteStub . callCount , 0 , "stderr info should not be provided " ) ;
81
80
} ) ;
82
81
83
82
test . serial ( "checkRequirements: Using unsupported Node.js version" , ( t ) => {
@@ -149,7 +148,7 @@ test.serial("checkRequirements: logs warning when using pre-release Node.js vers
149
148
} ) ;
150
149
151
150
test . serial ( "invokeLocalInstallation: Invokes local installation when found" , async ( t ) => {
152
- const { processStderrWriteStub, consoleInfoStub } = t . context ;
151
+ const { processStderrWriteStub} = t . context ;
153
152
154
153
importLocalStub . returns ( { } ) ;
155
154
@@ -159,11 +158,10 @@ test.serial("invokeLocalInstallation: Invokes local installation when found", as
159
158
160
159
t . true ( returnValue ) ;
161
160
162
- t . is ( processStderrWriteStub . callCount , 0 , "console.log should not be called" ) ;
163
- t . is ( consoleInfoStub . callCount , 2 , "console.info should be called 2 times" ) ;
161
+ t . is ( processStderrWriteStub . callCount , 2 , "Information messages should be provided" ) ;
164
162
165
- t . deepEqual ( consoleInfoStub . getCall ( 0 ) . args , [ "INFO: Using local ui5-cli-test installation" ] ) ;
166
- t . deepEqual ( consoleInfoStub . getCall ( 1 ) . args , [ "" ] ) ;
163
+ t . deepEqual ( processStderrWriteStub . getCall ( 0 ) . args , [ "INFO: Using local ui5-cli-test installation" ] ) ;
164
+ t . deepEqual ( processStderrWriteStub . getCall ( 1 ) . args , [ "\n\n " ] ) ;
167
165
168
166
t . is ( importLocalStub . callCount , 1 , "import-local should be called once" ) ;
169
167
t . is ( importLocalStub . getCall ( 0 ) . args . length , 1 ) ;
@@ -173,7 +171,7 @@ test.serial("invokeLocalInstallation: Invokes local installation when found", as
173
171
} ) ;
174
172
175
173
test . serial ( "invokeLocalInstallation: Invokes local installation when found (/w --verbose)" , async ( t ) => {
176
- const { processStderrWriteStub, consoleInfoStub } = t . context ;
174
+ const { processStderrWriteStub} = t . context ;
177
175
178
176
importLocalStub . returns ( { } ) ;
179
177
@@ -186,16 +184,15 @@ test.serial("invokeLocalInstallation: Invokes local installation when found (/w
186
184
187
185
t . true ( returnValue ) ;
188
186
189
- t . is ( processStderrWriteStub . callCount , 0 , "console.log should not be called" ) ;
190
- t . is ( consoleInfoStub . callCount , 3 , "console.info should be called 3 times" ) ;
187
+ t . is ( processStderrWriteStub . callCount , 4 , "console.info should be called 3 times" ) ;
191
188
192
- t . deepEqual ( consoleInfoStub . getCall ( 0 ) . args , [
189
+ t . deepEqual ( processStderrWriteStub . getCall ( 0 ) . args , [
193
190
"INFO: This project contains an individual ui5-cli-test installation which " +
194
191
"will be used over the global one." ] ) ;
195
- t . deepEqual ( consoleInfoStub . getCall ( 1 ) . args , [
192
+ t . deepEqual ( processStderrWriteStub . getCall ( 2 ) . args , [
196
193
"See https://github.com/SAP/ui5-cli#local-vs-global-installation for details."
197
194
] ) ;
198
- t . deepEqual ( consoleInfoStub . getCall ( 2 ) . args , [ "" ] ) ;
195
+ t . deepEqual ( processStderrWriteStub . getCall ( 3 ) . args , [ "\n\n " ] ) ;
199
196
200
197
t . is ( importLocalStub . callCount , 1 , "import-local should be called once" ) ;
201
198
t . is ( importLocalStub . getCall ( 0 ) . args . length , 1 ) ;
@@ -205,7 +202,7 @@ test.serial("invokeLocalInstallation: Invokes local installation when found (/w
205
202
} ) ;
206
203
207
204
test . serial ( "invokeLocalInstallation: Doesn't invoke local installation when UI5_CLI_NO_LOCAL is set" , async ( t ) => {
208
- const { processStderrWriteStub, consoleInfoStub } = t . context ;
205
+ const { processStderrWriteStub} = t . context ;
209
206
210
207
process . env . UI5_CLI_NO_LOCAL = "true" ;
211
208
@@ -215,14 +212,13 @@ test.serial("invokeLocalInstallation: Doesn't invoke local installation when UI5
215
212
216
213
t . false ( returnValue ) ;
217
214
218
- t . is ( processStderrWriteStub . callCount , 0 , "console.log should not be called" ) ;
219
- t . is ( consoleInfoStub . callCount , 0 , "console.info should not be called" ) ;
215
+ t . is ( processStderrWriteStub . callCount , 0 , "Information messages should be provided" ) ;
220
216
221
217
t . is ( importLocalStub . callCount , 0 , "import-local should not be called" ) ;
222
218
} ) ;
223
219
224
220
test . serial ( "invokeLocalInstallation: Doesn't invoke local installation when it is not found" , async ( t ) => {
225
- const { processStderrWriteStub, consoleInfoStub } = t . context ;
221
+ const { processStderrWriteStub} = t . context ;
226
222
227
223
importLocalStub . returns ( undefined ) ;
228
224
@@ -232,8 +228,7 @@ test.serial("invokeLocalInstallation: Doesn't invoke local installation when it
232
228
233
229
t . false ( returnValue ) ;
234
230
235
- t . is ( processStderrWriteStub . callCount , 0 , "console.log should not be called" ) ;
236
- t . is ( consoleInfoStub . callCount , 0 , "console.info should not be called" ) ;
231
+ t . is ( processStderrWriteStub . callCount , 0 , "stderr info should not be provided" ) ;
237
232
238
233
t . is ( importLocalStub . callCount , 1 , "import-local should be called" ) ;
239
234
} ) ;
0 commit comments