| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 24e24bd commit dbc696d
22 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,7 +33,7 @@ const fnsToTest = [setTimeout, (cb) => { | |||
| 33 | 33 | ||
| 34 | 34 | const hook = async_hooks.createHook({ | |
| 35 | 35 | before: common.mustNotCall(), | |
| 36 | - after: common.mustCall(() => {}, 3), | ||
| 36 | + after: common.mustCall(3), | ||
| 37 | 37 | destroy: common.mustCall(() => { | |
| 38 | 38 | hook.disable(); | |
| 39 | 39 | nextTest(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ const promise = new Promise((resolve) => { | |||
| 12 | 12 | setTimeout(() => { | |
| 13 | 13 | initialAsyncId = async_hooks.executionAsyncId(); | |
| 14 | 14 | async_hooks.createHook({ | |
| 15 | - after: common.mustCall(() => {}, 2) | ||
| 15 | + after: common.mustCall(2) | ||
| 16 | 16 | }).enable(); | |
| 17 | 17 | resolve(); | |
| 18 | 18 | }, 0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ const assert = require('assert'); | |||
| 4 | 4 | const async_hooks = require('async_hooks'); | |
| 5 | 5 | ||
| 6 | 6 | const hook = async_hooks.createHook({ | |
| 7 | - init: common.mustCall(() => {}, 1), | ||
| 7 | + init: common.mustCall(1), | ||
| 8 | 8 | before: common.mustNotCall(), | |
| 9 | 9 | after: common.mustNotCall(), | |
| 10 | 10 | destroy: common.mustNotCall() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,5 +45,5 @@ if (cluster.isWorker) { | |||
| 45 | 45 | }, 1)); | |
| 46 | 46 | ||
| 47 | 47 | // Check if the cluster was killed as well | |
| 48 | - cluster.on('exit', common.mustCall(() => {}, 1)); | ||
| 48 | + cluster.on('exit', common.mustCall(1)); | ||
| 49 | 49 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,20 +70,20 @@ assert.throws( | |||
| 70 | 70 | message: /^fhqwhgads$/ | |
| 71 | 71 | }); | |
| 72 | 72 | ||
| 73 | - const fnOnce = common.mustCall(() => {}); | ||
| 73 | + const fnOnce = common.mustCall(); | ||
| 74 | 74 | fnOnce(); | |
| 75 | - const fnTwice = common.mustCall(() => {}, 2); | ||
| 75 | + const fnTwice = common.mustCall(2); | ||
| 76 | 76 | fnTwice(); | |
| 77 | 77 | fnTwice(); | |
| 78 | - const fnAtLeast1Called1 = common.mustCallAtLeast(() => {}, 1); | ||
| 78 | + const fnAtLeast1Called1 = common.mustCallAtLeast(1); | ||
| 79 | 79 | fnAtLeast1Called1(); | |
| 80 | - const fnAtLeast1Called2 = common.mustCallAtLeast(() => {}, 1); | ||
| 80 | + const fnAtLeast1Called2 = common.mustCallAtLeast(1); | ||
| 81 | 81 | fnAtLeast1Called2(); | |
| 82 | 82 | fnAtLeast1Called2(); | |
| 83 | - const fnAtLeast2Called2 = common.mustCallAtLeast(() => {}, 2); | ||
| 83 | + const fnAtLeast2Called2 = common.mustCallAtLeast(2); | ||
| 84 | 84 | fnAtLeast2Called2(); | |
| 85 | 85 | fnAtLeast2Called2(); | |
| 86 | - const fnAtLeast2Called3 = common.mustCallAtLeast(() => {}, 2); | ||
| 86 | + const fnAtLeast2Called3 = common.mustCallAtLeast(2); | ||
| 87 | 87 | fnAtLeast2Called3(); | |
| 88 | 88 | fnAtLeast2Called3(); | |
| 89 | 89 | fnAtLeast2Called3(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,7 +95,7 @@ const BUFFER_SIZE = 4096; | |||
| 95 | 95 | assert.fail(err.message); | |
| 96 | 96 | }); | |
| 97 | 97 | ||
| 98 | - socket.on('close', common.mustCall(() => {})); | ||
| 98 | + socket.on('close', common.mustCall()); | ||
| 99 | 99 | })); | |
| 100 | 100 | ||
| 101 | 101 | receiver.on('message', common.mustCall((data, { address, port }) => { | |
@@ -109,7 +109,7 @@ const BUFFER_SIZE = 4096; | |||
| 109 | 109 | assert.fail(err.message); | |
| 110 | 110 | }); | |
| 111 | 111 | ||
| 112 | - receiver.on('close', common.mustCall(() => {})); | ||
| 112 | + receiver.on('close', common.mustCall()); | ||
| 113 | 113 | } | |
| 114 | 114 | ||
| 115 | 115 | testWithOptions(true, true); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,5 +7,5 @@ const { Resolver } = require('dns'); | |||
| 7 | 7 | const resolver = new Resolver(); | |
| 8 | 8 | assert(resolver.getServers().length > 0); | |
| 9 | 9 | // return undefined | |
| 10 | - resolver._handle.getServers = common.mustCall(() => {}); | ||
| 10 | + resolver._handle.getServers = common.mustCall(); | ||
| 11 | 11 | assert.strictEqual(resolver.getServers().length, 0); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,12 +151,12 @@ fs.stat(__filename, common.mustSucceed((s) => { | |||
| 151 | 151 | }); | |
| 152 | 152 | ||
| 153 | 153 | // Should not throw an error | |
| 154 | - fs.stat(__filename, undefined, common.mustCall(() => {})); | ||
| 154 | + fs.stat(__filename, undefined, common.mustCall()); | ||
| 155 | 155 | ||
| 156 | 156 | fs.open(__filename, 'r', undefined, common.mustCall((err, fd) => { | |
| 157 | 157 | // Should not throw an error | |
| 158 | - fs.fstat(fd, undefined, common.mustCall(() => {})); | ||
| 158 | + fs.fstat(fd, undefined, common.mustCall()); | ||
| 159 | 159 | })); | |
| 160 | 160 | ||
| 161 | 161 | // Should not throw an error | |
| 162 | - fs.lstat(__filename, undefined, common.mustCall(() => {})); | ||
| 162 | + fs.lstat(__filename, undefined, common.mustCall()); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,6 +37,6 @@ watcher.addListener('change', () => { | |||
| 37 | 37 | fs.rmdirSync(root); | |
| 38 | 38 | // Wait for the listener to hit | |
| 39 | 39 | setTimeout( | |
| 40 | - common.mustCall(() => {}), | ||
| 40 | + common.mustCall(), | ||
| 41 | 41 | common.platformTimeout(100) | |
| 42 | 42 | ); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ server.listen(0, common.mustCall(() => { | |||
| 23 | 23 | const client = http2.connect(`http://localhost:${server.address().port}`); | |
| 24 | 24 | const req = client.request(); | |
| 25 | 25 | ||
| 26 | - req.on('response', common.mustCall(() => {})); | ||
| 26 | + req.on('response', common.mustCall()); | ||
| 27 | 27 | req.once('data', common.mustCall(() => { | |
| 28 | 28 | net.Socket.prototype.destroy.call(client.socket); | |
| 29 | 29 | server.close(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments