|
2 | 2 | // Original test written by Jakub Lekstan <[email protected]>
|
3 | 3 | const common = require('../common');
|
4 | 4 |
|
5 |
| -require('../common'); |
6 | 5 | // FIXME add sunos support
|
7 | 6 | if (!(common.isFreeBSD || common.isOSX || common.isLinux)) {
|
8 | 7 | console.log(`1..0 # Skipped: Unsupported platform [${process.platform}]`);
|
9 | 8 | return;
|
10 | 9 | }
|
11 | 10 |
|
12 |
| -var assert = require('assert'); |
13 |
| -var exec = require('child_process').exec; |
14 |
| -var path = require('path'); |
| 11 | +const assert = require('assert'); |
| 12 | +const exec = require('child_process').exec; |
| 13 | +const path = require('path'); |
15 | 14 |
|
16 | 15 | // The title shouldn't be too long; libuv's uv_set_process_title() out of
|
17 | 16 | // security considerations no longer overwrites envp, only argv, so the
|
18 | 17 | // maximum title length is possibly quite short.
|
19 |
| -var title = 'testme'; |
| 18 | +let title = 'testme'; |
20 | 19 |
|
21 |
| -assert.notEqual(process.title, title); |
| 20 | +assert.notStrictEqual(process.title, title); |
22 | 21 | process.title = title;
|
23 |
| -assert.equal(process.title, title); |
| 22 | +assert.strictEqual(process.title, title); |
24 | 23 |
|
25 |
| -exec('ps -p ' + process.pid + ' -o args=', function(error, stdout, stderr) { |
26 |
| - assert.equal(error, null); |
27 |
| - assert.equal(stderr, ''); |
| 24 | +exec(`ps -p ${process.pid} -o args=`, function callback(error, stdout, stderr) { |
| 25 | + assert.ifError(error); |
| 26 | + assert.strictEqual(stderr, ''); |
28 | 27 |
|
29 | 28 | // freebsd always add ' (procname)' to the process title
|
30 | 29 | if (common.isFreeBSD)
|
31 | 30 | title += ` (${path.basename(process.execPath)})`;
|
32 | 31 |
|
33 | 32 | // omitting trailing whitespace and \n
|
34 |
| - assert.equal(stdout.replace(/\s+$/, ''), title); |
| 33 | + assert.strictEqual(stdout.replace(/\s+$/, ''), title); |
35 | 34 | });
|
0 commit comments