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 a64af39

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: remove duplicate required module
`common` is required twice in test-setproctitle.js. Remove one of the instances. Other refactoring: * var -> const and let * assert.equal -> assert.strictEqual * assert.notEqual -> assert.notStrickEqual * string concatenation -> template string * use of assert.ifError() instead of asserting error is null PR-URL: #9169 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent a038fcc commit a64af39
Copy full SHA for a64af39

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-setproctitle.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-setproctitle.js
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@ if ('linux freebsd darwin'.indexOf(process.platform) === -1) {
88
return;
99
}
1010

11-
var assert = require('assert');
12-
var exec = require('child_process').exec;
13-
var path = require('path');
11+
const assert = require('assert');
12+
const exec = require('child_process').exec;
13+
const path = require('path');
1414

1515
// The title shouldn't be too long; libuv's uv_set_process_title() out of
1616
// security considerations no longer overwrites envp, only argv, so the
1717
// maximum title length is possibly quite short.
18-
var title = 'testme';
18+
let title = 'testme';
1919

20-
assert.notEqual(process.title, title);
20+
assert.notStrictEqual(process.title, title);
2121
process.title = title;
22-
assert.equal(process.title, title);
22+
assert.strictEqual(process.title, title);
2323

24-
exec('ps -p ' + process.pid + ' -o args=', function(error, stdout, stderr) {
25-
assert.equal(error, null);
26-
assert.equal(stderr, '');
24+
exec(`ps -p ${process.pid} -o args=`, function callback(error, stdout, stderr) {
25+
assert.ifError(error);
26+
assert.strictEqual(stderr, '');
2727

2828
// freebsd always add ' (procname)' to the process title
2929
if (process.platform === 'freebsd')
3030
title += ` (${path.basename(process.execPath)})`;
3131

3232
// omitting trailing whitespace and \n
33-
assert.equal(stdout.replace(/\s+$/, ''), title);
33+
assert.strictEqual(stdout.replace(/\s+$/, ''), title);
3434
});

0 commit comments

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