Skip to content

Commit 30de036

Browse files
andresatenciotargos
authored andcommitted
test: replace function with arrow function and remove unused argument
PR-URL: #38235 Reviewed-By: Yash Ladha <yash@yashladha.in> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 8a90f55 commit 30de036

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎test/parallel/test-readline-interface.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
277277
constexpectedLines=['foo','bar','baz','bar','bat','bat'];
278278
// ['foo', 'baz', 'bar', bat'];
279279
letcallCount=0;
280-
rli.on('line',function(line){
280+
rli.on('line',(line)=>{
281281
assert.strictEqual(line,expectedLines[callCount]);
282282
callCount++;
283283
});
@@ -353,7 +353,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
353353
});
354354
constexpectedLines=['foo','bar','baz','bar','bat','bat'];
355355
letcallCount=0;
356-
rli.on('line',function(line){
356+
rli.on('line',(line)=>{
357357
assert.strictEqual(line,expectedLines[callCount]);
358358
callCount++;
359359
});
@@ -380,7 +380,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
380380
const[rli,fi]=getInterface({terminal: true});
381381
constkeys=[];
382382
consterr=newError('bad thing happened');
383-
fi.on('keypress',function(key){
383+
fi.on('keypress',(key)=>{
384384
keys.push(key);
385385
if(key==='X'){
386386
throwerr;
@@ -795,7 +795,7 @@ for (let i = 0; i < 12; i++) {
795795
assert.strictEqual(isWarned(process.stdout._events),false);
796796
}
797797

798-
[true,false].forEach(function(terminal){
798+
[true,false].forEach((terminal)=>{
799799
// Disable history
800800
{
801801
const[rli,fi]=getInterface({ terminal,historySize: 0});
@@ -890,7 +890,7 @@ for (let i = 0; i < 12; i++) {
890890
constbuf=Buffer.from('☮','utf8');
891891
const[rli,fi]=getInterface({ terminal });
892892
letcallCount=0;
893-
rli.on('line',function(line){
893+
rli.on('line',(line)=>{
894894
callCount++;
895895
assert.strictEqual(line,buf.toString('utf8'));
896896
});
@@ -1004,7 +1004,7 @@ for (let i = 0; i < 12; i++) {
10041004
rli.setPrompt('ddd> ');
10051005
rli.prompt();
10061006
rli.write("really shouldn't be seeing this");
1007-
rli.question('What do you think of node.js? ',function(answer){
1007+
rli.question('What do you think of node.js? ',(answer)=>{
10081008
console.log('Thank you for your valuable feedback:',answer);
10091009
rli.close();
10101010
});
@@ -1056,7 +1056,7 @@ for (let i = 0; i < 12; i++) {
10561056
constcrlfDelay=200;
10571057
const[rli,fi]=getInterface({ terminal, crlfDelay });
10581058
letcallCount=0;
1059-
rli.on('line',function(line){
1059+
rli.on('line',()=>{
10601060
callCount++;
10611061
});
10621062
fi.emit('data','\r');
@@ -1078,7 +1078,7 @@ for (let i = 0; i < 12; i++) {
10781078
constdelay=200;
10791079
const[rli,fi]=getInterface({ terminal, crlfDelay });
10801080
letcallCount=0;
1081-
rli.on('line',function(line){
1081+
rli.on('line',()=>{
10821082
callCount++;
10831083
});
10841084
fi.emit('data','\r');

0 commit comments

Comments
 (0)