Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: replace function with arrow function and remove unused argument #38235

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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