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
  • Loading branch information
andresatencio committed Apr 14, 2021
1 parent 6c9b19a commit c078efb
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 c078efb

Please sign in to comment.