Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 30de036

Browse filesBrowse files
andresatenciotargos
authored andcommitted
test: replace function with arrow function and remove unused argument
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>
1 parent 8a90f55 commit 30de036
Copy full SHA for 30de036

File tree

Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-readline-interface.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readline-interface.js
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
277277
const expectedLines = ['foo', 'bar', 'baz', 'bar', 'bat', 'bat'];
278278
// ['foo', 'baz', 'bar', bat'];
279279
let callCount = 0;
280-
rli.on('line', function(line) {
280+
rli.on('line', (line) => {
281281
assert.strictEqual(line, expectedLines[callCount]);
282282
callCount++;
283283
});
@@ -353,7 +353,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
353353
});
354354
const expectedLines = ['foo', 'bar', 'baz', 'bar', 'bat', 'bat'];
355355
let callCount = 0;
356-
rli.on('line', function(line) {
356+
rli.on('line', (line) => {
357357
assert.strictEqual(line, expectedLines[callCount]);
358358
callCount++;
359359
});
@@ -380,7 +380,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
380380
const [rli, fi] = getInterface({ terminal: true });
381381
const keys = [];
382382
const err = new Error('bad thing happened');
383-
fi.on('keypress', function(key) {
383+
fi.on('keypress', (key) => {
384384
keys.push(key);
385385
if (key === 'X') {
386386
throw err;
@@ -795,7 +795,7 @@ for (let i = 0; i < 12; i++) {
795795
assert.strictEqual(isWarned(process.stdout._events), false);
796796
}
797797

798-
[true, false].forEach(function(terminal) {
798+
[true, false].forEach((terminal) => {
799799
// Disable history
800800
{
801801
const [rli, fi] = getInterface({ terminal, historySize: 0 });
@@ -890,7 +890,7 @@ for (let i = 0; i < 12; i++) {
890890
const buf = Buffer.from('☮', 'utf8');
891891
const [rli, fi] = getInterface({ terminal });
892892
let callCount = 0;
893-
rli.on('line', function(line) {
893+
rli.on('line', (line) => {
894894
callCount++;
895895
assert.strictEqual(line, buf.toString('utf8'));
896896
});
@@ -1004,7 +1004,7 @@ for (let i = 0; i < 12; i++) {
10041004
rli.setPrompt('ddd> ');
10051005
rli.prompt();
10061006
rli.write("really shouldn't be seeing this");
1007-
rli.question('What do you think of node.js? ', function(answer) {
1007+
rli.question('What do you think of node.js? ', (answer) => {
10081008
console.log('Thank you for your valuable feedback:', answer);
10091009
rli.close();
10101010
});
@@ -1056,7 +1056,7 @@ for (let i = 0; i < 12; i++) {
10561056
const crlfDelay = 200;
10571057
const [rli, fi] = getInterface({ terminal, crlfDelay });
10581058
let callCount = 0;
1059-
rli.on('line', function(line) {
1059+
rli.on('line', () => {
10601060
callCount++;
10611061
});
10621062
fi.emit('data', '\r');
@@ -1078,7 +1078,7 @@ for (let i = 0; i < 12; i++) {
10781078
const delay = 200;
10791079
const [rli, fi] = getInterface({ terminal, crlfDelay });
10801080
let callCount = 0;
1081-
rli.on('line', function(line) {
1081+
rli.on('line', () => {
10821082
callCount++;
10831083
});
10841084
fi.emit('data', '\r');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.