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 8f7326c

Browse filesBrowse files
Amanpreet-03codebytere
authored andcommitted
test: replace anonymous closure functions with arrow function
PR-URL: #24417 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 644a9d6 commit 8f7326c
Copy full SHA for 8f7326c

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-error-reporting.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-error-reporting.js
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const fixtures = require('../common/fixtures');
2727

2828
function errExec(script, callback) {
2929
const cmd = `"${process.argv[0]}" "${fixtures.path(script)}"`;
30-
return exec(cmd, function(err, stdout, stderr) {
30+
return exec(cmd, (err, stdout, stderr) => {
3131
// There was some error
3232
assert.ok(err);
3333

@@ -43,39 +43,39 @@ const syntaxErrorMessage = /\bSyntaxError\b/;
4343

4444

4545
// Simple throw error
46-
errExec('throws_error.js', common.mustCall(function(err, stdout, stderr) {
46+
errExec('throws_error.js', common.mustCall((err, stdout, stderr) => {
4747
assert.ok(/blah/.test(stderr));
4848
}));
4949

5050

5151
// Trying to JSON.parse(undefined)
52-
errExec('throws_error2.js', common.mustCall(function(err, stdout, stderr) {
52+
errExec('throws_error2.js', common.mustCall((err, stdout, stderr) => {
5353
assert.ok(syntaxErrorMessage.test(stderr));
5454
}));
5555

5656

5757
// Trying to JSON.parse(undefined) in nextTick
58-
errExec('throws_error3.js', common.mustCall(function(err, stdout, stderr) {
58+
errExec('throws_error3.js', common.mustCall((err, stdout, stderr) => {
5959
assert.ok(syntaxErrorMessage.test(stderr));
6060
}));
6161

6262

6363
// throw ILLEGAL error
64-
errExec('throws_error4.js', common.mustCall(function(err, stdout, stderr) {
64+
errExec('throws_error4.js', common.mustCall((err, stdout, stderr) => {
6565
assert.ok(syntaxErrorMessage.test(stderr));
6666
}));
6767

6868
// Specific long exception line doesn't result in stack overflow
69-
errExec('throws_error5.js', common.mustCall(function(err, stdout, stderr) {
69+
errExec('throws_error5.js', common.mustCall((err, stdout, stderr) => {
7070
assert.ok(syntaxErrorMessage.test(stderr));
7171
}));
7272

7373
// Long exception line with length > errorBuffer doesn't result in assertion
74-
errExec('throws_error6.js', common.mustCall(function(err, stdout, stderr) {
74+
errExec('throws_error6.js', common.mustCall((err, stdout, stderr) => {
7575
assert.ok(syntaxErrorMessage.test(stderr));
7676
}));
7777

7878
// Object that throws in toString() doesn't print garbage
79-
errExec('throws_error7.js', common.mustCall(function(err, stdout, stderr) {
79+
errExec('throws_error7.js', common.mustCall((err, stdout, stderr) => {
8080
assert.ok(/<toString\(\) threw exception/.test(stderr));
8181
}));

0 commit comments

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