| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b56d8af commit f4722b1
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,19 +33,19 @@ const subScript = fixtures.path('child-process-persistent.js'); | |||
| 33 | 33 | ||
| 34 | 34 | // Sending a handle and not giving the tickQueue time to acknowledge should | |
| 35 | 35 | // create the internal backlog, but leave it empty. | |
| 36 | - const rv1 = s.send('one', handle, (err) => { if (err) assert.fail(err); }); | ||
| 36 | + const rv1 = s.send('one', handle, assert.ifError); | ||
| 37 | 37 | assert.strictEqual(rv1, true); | |
| 38 | 38 | // Since the first `send` included a handle (should be unacknowledged), | |
| 39 | 39 | // we can safely queue up only one more message. | |
| 40 | - const rv2 = s.send('two', (err) => { if (err) assert.fail(err); }); | ||
| 40 | + const rv2 = s.send('two', assert.ifError); | ||
| 41 | 41 | assert.strictEqual(rv2, true); | |
| 42 | 42 | // The backlog should now be indicate to backoff. | |
| 43 | - const rv3 = s.send('three', (err) => { if (err) assert.fail(err); }); | ||
| 43 | + const rv3 = s.send('three', assert.ifError); | ||
| 44 | 44 | assert.strictEqual(rv3, false); | |
| 45 | 45 | const rv4 = s.send('four', (err) => { | |
| 46 | - if (err) assert.fail(err); | ||
| 46 | + assert.ifError(err); | ||
| 47 | 47 | // `send` queue should have been drained. | |
| 48 | - const rv5 = s.send('5', handle, (err) => { if (err) assert.fail(err); }); | ||
| 48 | + const rv5 = s.send('5', handle, assert.ifError); | ||
| 49 | 49 | assert.strictEqual(rv5, true); | |
| 50 | 50 | ||
| 51 | 51 | // End test and cleanup. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,9 +41,13 @@ const net = require('net'); | |||
| 41 | 41 | receiveSocket.bind(0, common.localhostIPv4, common.mustCall(() => { | |
| 42 | 42 | const addressInfo = receiveSocket.address(); | |
| 43 | 43 | const client = dgram.createSocket('udp4'); | |
| 44 | - client.send('hello', addressInfo.port, addressInfo.address, common.mustCall((err) => { | ||
| 45 | - assert.ok(!err); | ||
| 46 | - client.close(); | ||
| 47 | - })); | ||
| 44 | + client.send( | ||
| 45 | + 'hello', | ||
| 46 | + addressInfo.port, | ||
| 47 | + addressInfo.address, | ||
| 48 | + common.mustSucceed(() => { | ||
| 49 | + client.close(); | ||
| 50 | + }) | ||
| 51 | + ); | ||
| 48 | 52 | })); | |
| 49 | 53 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -94,9 +94,7 @@ if (common.isLinux || common.isMacOS || common.isWindows) { | |||
| 94 | 94 | })); | |
| 95 | 95 | ||
| 96 | 96 | const interval = setInterval(() => { | |
| 97 | - fs.writeFile(path.join(dir, 'foo.txt'), 'foo', common.mustCall((err) => { | ||
| 98 | - if (err) assert.fail(err); | ||
| 99 | - })); | ||
| 97 | + fs.writeFile(path.join(dir, 'foo.txt'), 'foo', common.mustSucceed()); | ||
| 100 | 98 | }, 1); | |
| 101 | 99 | } | |
| 102 | 100 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments