| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1158f44 commit 4d916da
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 2 | + const common = require('../common'); | ||
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | const fork = require('child_process').fork; | |
| 5 | 5 | const net = require('net'); | |
@@ -60,9 +60,10 @@ if (process.argv[2] === 'child') { | |||
| 60 | 60 | ||
| 61 | 61 | const child = fork(process.argv[1], ['child']); | |
| 62 | 62 | ||
| 63 | - child.on('exit', function() { | ||
| 64 | - console.log('CHILD: died'); | ||
| 65 | - }); | ||
| 63 | + child.on('exit', common.mustCall(function(code, signal) { | ||
| 64 | + const message = `CHILD: died with ${code}, ${signal}`; | ||
| 65 | + assert.strictEqual(code, 0, message); | ||
| 66 | + })); | ||
| 66 | 67 | ||
| 67 | 68 | // send net.Server to child and test by connecting | |
| 68 | 69 | const testServer = function(callback) { | |
@@ -171,7 +172,6 @@ if (process.argv[2] === 'child') { | |||
| 171 | 172 | ||
| 172 | 173 | testSocket(function() { | |
| 173 | 174 | socketSuccess = true; | |
| 174 | - child.kill(); | ||
| 175 | 175 | }); | |
| 176 | 176 | }); | |
| 177 | 177 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments