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 Jun 11, 2021
1 parent e994d6a commit c9ce98c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/parallel/test-readline-interface.js
Expand Up @@ -248,7 +248,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 @@ -324,7 +324,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 @@ -351,7 +351,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 @@ -766,7 +766,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 @@ -861,7 +861,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 @@ -905,7 +905,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 @@ -957,7 +957,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 @@ -979,7 +979,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 c9ce98c

Please sign in to comment.