diff options
author | Andres <and.atencio@gmail.com> | 2021-04-13 23:30:12 -0300 |
---|---|---|
committer | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2021-04-21 23:25:41 +0200 |
commit | 4243ce03182aea72aefdd2ff29ecc1affbc59716 (patch) | |
tree | 12b2b613b4969fd219271aaebafd8c107c514b44 | |
parent | 5370220ab2e8978611a827ac11aba1318bb93969 (diff) | |
download | node-new-4243ce03182aea72aefdd2ff29ecc1affbc59716.tar.gz |
test: replace function with arrow function and remove unused argument
PR-URL: https://github.com/nodejs/node/pull/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>
-rw-r--r-- | test/parallel/test-readline-interface.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index afa9fd33d2..a3020181b3 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -277,7 +277,7 @@ function assertCursorRowsAndCols(rli, rows, cols) { const expectedLines = ['foo', 'bar', 'baz', 'bar', 'bat', 'bat']; // ['foo', 'baz', 'bar', bat']; let callCount = 0; - rli.on('line', function(line) { + rli.on('line', (line) => { assert.strictEqual(line, expectedLines[callCount]); callCount++; }); @@ -353,7 +353,7 @@ function assertCursorRowsAndCols(rli, rows, cols) { }); const expectedLines = ['foo', 'bar', 'baz', 'bar', 'bat', 'bat']; let callCount = 0; - rli.on('line', function(line) { + rli.on('line', (line) => { assert.strictEqual(line, expectedLines[callCount]); callCount++; }); @@ -380,7 +380,7 @@ function assertCursorRowsAndCols(rli, rows, cols) { const [rli, fi] = getInterface({ terminal: true }); const keys = []; const err = new Error('bad thing happened'); - fi.on('keypress', function(key) { + fi.on('keypress', (key) => { keys.push(key); if (key === 'X') { throw err; @@ -795,7 +795,7 @@ for (let i = 0; i < 12; i++) { assert.strictEqual(isWarned(process.stdout._events), false); } -[true, false].forEach(function(terminal) { +[true, false].forEach((terminal) => { // Disable history { const [rli, fi] = getInterface({ terminal, historySize: 0 }); @@ -890,7 +890,7 @@ for (let i = 0; i < 12; i++) { const buf = Buffer.from('☮', 'utf8'); const [rli, fi] = getInterface({ terminal }); let callCount = 0; - rli.on('line', function(line) { + rli.on('line', (line) => { callCount++; assert.strictEqual(line, buf.toString('utf8')); }); @@ -1004,7 +1004,7 @@ for (let i = 0; i < 12; i++) { rli.setPrompt('ddd> '); rli.prompt(); rli.write("really shouldn't be seeing this"); - rli.question('What do you think of node.js? ', function(answer) { + rli.question('What do you think of node.js? ', (answer) => { console.log('Thank you for your valuable feedback:', answer); rli.close(); }); @@ -1056,7 +1056,7 @@ for (let i = 0; i < 12; i++) { const crlfDelay = 200; const [rli, fi] = getInterface({ terminal, crlfDelay }); let callCount = 0; - rli.on('line', function(line) { + rli.on('line', () => { callCount++; }); fi.emit('data', '\r'); @@ -1078,7 +1078,7 @@ for (let i = 0; i < 12; i++) { const delay = 200; const [rli, fi] = getInterface({ terminal, crlfDelay }); let callCount = 0; - rli.on('line', function(line) { + rli.on('line', () => { callCount++; }); fi.emit('data', '\r'); |