@@ -27,8 +27,8 @@ test.cb('hook stdout & stderr', t => {
2727
2828 let i = 0 ;
2929
30- const promise = hookStd ( str => {
31- if ( str === 'foo' || str === 'bar' ) {
30+ const promise = hookStd ( string => {
31+ if ( string === 'foo' || string === 'bar' ) {
3232 t . pass ( ) ;
3333 }
3434
@@ -45,8 +45,8 @@ test.cb('hook stdout & stderr', t => {
4545test . cb ( 'hook stdout' , t => {
4646 t . plan ( 1 ) ;
4747
48- const promise = hookStd . stdout ( str => {
49- t . is ( str , 'foo' ) ;
48+ const promise = hookStd . stdout ( string => {
49+ t . is ( string , 'foo' ) ;
5050 promise . unhook ( ) ;
5151 t . end ( ) ;
5252 } ) ;
@@ -57,8 +57,8 @@ test.cb('hook stdout', t => {
5757test . cb ( 'hook stderr' , t => {
5858 t . plan ( 1 ) ;
5959
60- const promise = hookStd . stderr ( str => {
61- t . is ( str , 'foo' ) ;
60+ const promise = hookStd . stderr ( string => {
61+ t . is ( string , 'foo' ) ;
6262 promise . unhook ( ) ;
6363 t . end ( ) ;
6464 } ) ;
@@ -72,8 +72,8 @@ test.cb('hook custom stream', t => {
7272
7373 let i = 0 ;
7474
75- const promise = hookStd ( { streams} , str => {
76- if ( str === 'foo' ) {
75+ const promise = hookStd ( { streams} , string => {
76+ if ( string === 'foo' ) {
7777 t . pass ( ) ;
7878 }
7979
@@ -86,15 +86,15 @@ test.cb('hook custom stream', t => {
8686 streams [ 0 ] . write ( 'foo' ) ;
8787} ) ;
8888
89- function loggingWrite ( log , retVal ) {
89+ function loggingWrite ( log , returnValueValue ) {
9090 return ( ...items ) => {
9191 while ( items [ items . length - 1 ] === undefined ) {
9292 items . pop ( ) ;
9393 }
9494
9595 log . push ( items ) ;
9696
97- return retVal ( ) ;
97+ return returnValueValue ( ) ;
9898 } ;
9999}
100100
@@ -108,7 +108,7 @@ test('passes through the return value of the underlying write call', t => {
108108 write : loggingWrite ( log , ( ) => returnValue )
109109 } ;
110110
111- hookStd . stdout ( { silent : false } , str => str ) ;
111+ hookStd . stdout ( { silent : false } , string => string ) ;
112112
113113 t . false ( process . stdout . write ( 'foo' ) ) ;
114114 returnValue = true ;
@@ -124,9 +124,9 @@ test('if silent, returns true by default', t => {
124124 write : ( ) => t . fail ( )
125125 } ;
126126
127- hookStd . stdout ( str => {
128- log . push ( str ) ;
129- return str ;
127+ hookStd . stdout ( string => {
128+ log . push ( string ) ;
129+ return string ;
130130 } ) ;
131131
132132 t . true ( process . stdout . write ( 'foo' ) ) ;
@@ -142,8 +142,8 @@ test('if silent, callback can return a boolean', t => {
142142 write : ( ) => t . fail ( )
143143 } ;
144144
145- hookStd . stdout ( str => {
146- log . push ( str ) ;
145+ hookStd . stdout ( string => {
146+ log . push ( string ) ;
147147 return returnValue ;
148148 } ) ;
149149
@@ -161,7 +161,7 @@ test('callback can return a buffer', t => {
161161 write : loggingWrite ( log , ( ) => true )
162162 } ;
163163
164- hookStd . stdout ( { silent : false } , str => Buffer . from ( str ) ) ;
164+ hookStd . stdout ( { silent : false } , string => Buffer . from ( string ) ) ;
165165
166166 t . true ( process . stdout . write ( 'foo' ) ) ;
167167 t . true ( process . stdout . write ( 'bar' ) ) ;
@@ -177,7 +177,7 @@ test('if no options are assigned, behave as silent', t => {
177177 write : loggingWrite ( log , ( ) => returnValue )
178178 } ;
179179
180- hookStd . stdout ( str => str ) ;
180+ hookStd . stdout ( string => string ) ;
181181
182182 process . stdout . write ( 'foo' ) ;
183183 returnValue = true ;
@@ -193,7 +193,7 @@ test('if once option is true, only the first write is silent', t => {
193193 write : loggingWrite ( log , ( ) => returnValue )
194194 } ;
195195
196- hookStd . stdout ( { once : true } , str => str ) ;
196+ hookStd . stdout ( { once : true } , string => string ) ;
197197
198198 process . stdout . write ( 'foo' ) ;
199199 process . stdout . write ( 'bar' ) ;
@@ -211,9 +211,9 @@ test('if once option is true and silent is false, hook only prints the first wri
211211 write : loggingWrite ( log , ( ) => true )
212212 } ;
213213
214- hookStd . stdout ( { silent : false , once : true } , str => {
215- hookReturnValue = str ;
216- return str ;
214+ hookStd . stdout ( { silent : false , once : true } , string => {
215+ hookReturnValue = string ;
216+ return string ;
217217 } ) ;
218218
219219 process . stdout . write ( 'foo' ) ;
@@ -231,7 +231,7 @@ test('output is converted to string', t => {
231231 t . plan ( 4 ) ;
232232 const log = [ ] ;
233233
234- hookStd . stdout ( str => log . push ( str ) ) ;
234+ hookStd . stdout ( string => log . push ( string ) ) ;
235235
236236 process . stdout . write ( 'foo' ) ;
237237 t . deepEqual ( log , [ 'foo' ] ) ;
@@ -278,7 +278,7 @@ test('promise resolves when stdout & stderr are hooked and released via promise
278278 t . plan ( 1 ) ;
279279 const log = [ ] ;
280280
281- const promise = hookStd ( str => log . push ( str ) ) ;
281+ const promise = hookStd ( string => log . push ( string ) ) ;
282282
283283 process . stdout . write ( 'foo' ) ;
284284 process . stderr . write ( 'bar' ) ;
@@ -292,8 +292,8 @@ test('promise resolves when stdout & stderr are hooked and released via callback
292292 t . plan ( 1 ) ;
293293 const log = [ ] ;
294294
295- const promise = hookStd ( ( str , unhook ) => {
296- log . push ( str ) ;
295+ const promise = hookStd ( ( string , unhook ) => {
296+ log . push ( string ) ;
297297 unhook ( ) ;
298298 } ) ;
299299
@@ -306,8 +306,8 @@ test('promise resolves when stdout & stderr are hooked and released via callback
306306
307307test ( 'promise resolves when stdout is released via promise unhook method' , async t => {
308308 t . plan ( 1 ) ;
309- const promise = hookStd . stdout ( str => {
310- t . is ( str , 'foo' ) ;
309+ const promise = hookStd . stdout ( string => {
310+ t . is ( string , 'foo' ) ;
311311 } ) ;
312312 process . stdout . write ( 'foo' ) ;
313313 promise . unhook ( ) ;
@@ -316,8 +316,8 @@ test('promise resolves when stdout is released via promise unhook method', async
316316
317317test ( 'promise resolves when stderr is released via promise unhook method' , async t => {
318318 t . plan ( 1 ) ;
319- const promise = hookStd . stderr ( str => {
320- t . is ( str , 'foo' ) ;
319+ const promise = hookStd . stderr ( string => {
320+ t . is ( string , 'foo' ) ;
321321 } ) ;
322322 process . stderr . write ( 'foo' ) ;
323323 promise . unhook ( ) ;
@@ -329,8 +329,8 @@ test('promise resolves when streams are hooked and released via callback', async
329329 const log = [ ] ;
330330 const streams = [ { write : ( ) => { } } , { write : ( ) => { } } ] ;
331331
332- const promise = hookStd ( { streams} , ( str , unhook ) => {
333- log . push ( str ) ;
332+ const promise = hookStd ( { streams} , ( string , unhook ) => {
333+ log . push ( string ) ;
334334 unhook ( ) ;
335335 } ) ;
336336
0 commit comments