| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 76bb3cb commit 7d61bbf
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,14 +1,14 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 3 | - var assert = require('assert'); | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | 4 | ||
| 5 | - var spawn = require('child_process').spawn; | ||
| 6 | - var child = spawn(process.execPath, [], { | ||
| 5 | + const spawn = require('child_process').spawn; | ||
| 6 | + const child = spawn(process.execPath, [], { | ||
| 7 | 7 | env: Object.assign(process.env, { | |
| 8 | 8 | NODE_DEBUG: process.argv[2] | |
| 9 | 9 | }) | |
| 10 | 10 | }); | |
| 11 | - var wanted = child.pid + '\n'; | ||
| 11 | + const wanted = child.pid + '\n'; | ||
| 12 | 12 | var found = ''; | |
| 13 | 13 | ||
| 14 | 14 | child.stdout.setEncoding('utf8'); | |
@@ -21,12 +21,12 @@ child.stderr.on('data', function(c) { | |||
| 21 | 21 | console.error('> ' + c.trim().split(/\n/).join('\n> ')); | |
| 22 | 22 | }); | |
| 23 | 23 | ||
| 24 | - child.on('close', function(c) { | ||
| 25 | - assert(!c); | ||
| 26 | - assert.equal(found, wanted); | ||
| 24 | + child.on('close', common.mustCall(function(c) { | ||
| 25 | + assert.strictEqual(c, 0); | ||
| 26 | + assert.strictEqual(found, wanted); | ||
| 27 | 27 | console.log('ok'); | |
| 28 | - }); | ||
| 28 | + })); | ||
| 29 | 29 | ||
| 30 | 30 | setTimeout(function() { | |
| 31 | 31 | child.stdin.end('console.log(process.pid)'); | |
| 32 | - }); | ||
| 32 | + }, 1); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments