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 <[email protected]>
Reviewed-By: Pooja D P <[email protected]>
Reviewed-By: Harshitha K P <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
andresatencio authored and aduh95 committed Apr 21, 2021
1 parent 5370220 commit 4243ce0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/parallel/test-readline-interface.js
Original file line number Diff line number Diff line change
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 4243ce0

Please sign in to comment.