Skip to content

Commit

Permalink
test: replace function with arrow function and remove unused argument
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andresatencio authored and targos committed Apr 29, 2021
1 parent 8a90f55 commit 30de036
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/parallel/test-readline-interface.js
Expand Up @@ -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++;
});
Expand Down Expand Up @@ -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++;
});
Expand All @@ -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;
Expand Down Expand Up @@ -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 });
Expand Down Expand Up @@ -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'));
});
Expand Down Expand Up @@ -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();
});
Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit 30de036

Please sign in to comment.