diff options
author | Weijia Wang <381152119@qq.com> | 2018-03-25 22:27:38 +0800 |
---|---|---|
committer | Weijia Wang <381152119@qq.com> | 2018-04-01 22:33:13 +0800 |
commit | 254058109f469f64b8ca23bb65a206abab380604 (patch) | |
tree | 4069f77207f62816c248ed1ac9910467ff1b15d6 /test/parallel/test-cluster-basic.js | |
parent | f89f79893d6e15938f9237efe4d2473ab4a65e9f (diff) | |
download | android-node-v8-254058109f469f64b8ca23bb65a206abab380604.tar.gz android-node-v8-254058109f469f64b8ca23bb65a206abab380604.tar.bz2 android-node-v8-254058109f469f64b8ca23bb65a206abab380604.zip |
tools: add 'spaced-comment' into eslint rules
PR-URL: https://github.com/nodejs/node/pull/19596
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'test/parallel/test-cluster-basic.js')
-rw-r--r-- | test/parallel/test-cluster-basic.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/test/parallel/test-cluster-basic.js b/test/parallel/test-cluster-basic.js index 8a0a41f90c..0d51a18607 100644 --- a/test/parallel/test-cluster-basic.js +++ b/test/parallel/test-cluster-basic.js @@ -78,45 +78,45 @@ if (cluster.isWorker) { const stateNames = Object.keys(checks.worker.states); - //Check events, states, and emit arguments + // Check events, states, and emit arguments forEach(checks.cluster.events, (bool, name, index) => { - //Listen on event + // Listen on event cluster.on(name, common.mustCall(function(/* worker */) { - //Set event + // Set event checks.cluster.events[name] = true; - //Check argument + // Check argument checks.cluster.equal[name] = worker === arguments[0]; - //Check state + // Check state const state = stateNames[index]; checks.worker.states[state] = (state === worker.state); })); }); - //Kill worker when listening + // Kill worker when listening cluster.on('listening', common.mustCall(() => { worker.kill(); })); - //Kill process when worker is killed + // Kill process when worker is killed cluster.on('exit', common.mustCall()); - //Create worker + // Create worker const worker = cluster.fork(); assert.strictEqual(worker.id, 1); assert(worker instanceof cluster.Worker, 'the worker is not a instance of the Worker constructor'); - //Check event + // Check event forEach(checks.worker.events, function(bool, name, index) { worker.on(name, common.mustCall(function() { - //Set event + // Set event checks.worker.events[name] = true; - //Check argument + // Check argument checks.worker.equal[name] = (worker === this); switch (name) { @@ -146,33 +146,33 @@ if (cluster.isWorker) { })); }); - //Check all values + // Check all values process.once('exit', () => { - //Check cluster events + // Check cluster events forEach(checks.cluster.events, (check, name) => { assert(check, `The cluster event "${name}" on the cluster object did not fire`); }); - //Check cluster event arguments + // Check cluster event arguments forEach(checks.cluster.equal, (check, name) => { assert(check, `The cluster event "${name}" did not emit with correct argument`); }); - //Check worker states + // Check worker states forEach(checks.worker.states, (check, name) => { assert(check, `The worker state "${name}" was not set to true`); }); - //Check worker events + // Check worker events forEach(checks.worker.events, (check, name) => { assert(check, `The worker event "${name}" on the worker object did not fire`); }); - //Check worker event arguments + // Check worker event arguments forEach(checks.worker.equal, (check, name) => { assert(check, `The worker event "${name}" did not emit with correct argument`); |