summaryrefslogtreecommitdiff
path: root/jstests/replsets/reconfig.js
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:17:50 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:18:14 -0500
commit4ae691e8edc87d0e3cfb633bb91c328426be007b (patch)
tree52079a593f54382ca13a2e741633eab1b6271893 /jstests/replsets/reconfig.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/replsets/reconfig.js')
-rw-r--r--jstests/replsets/reconfig.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/jstests/replsets/reconfig.js b/jstests/replsets/reconfig.js
index c9dac4f6a9e..1351aa1d54b 100644
--- a/jstests/replsets/reconfig.js
+++ b/jstests/replsets/reconfig.js
@@ -2,10 +2,10 @@
* Simple test to ensure that an invalid reconfig fails, a valid one succeeds, and a reconfig won't
* succeed without force if force is needed.
*/
-(function () {
+(function() {
"use strict";
var numNodes = 5;
- var replTest = new ReplSetTest({ name: 'testSet', nodes: numNodes });
+ var replTest = new ReplSetTest({name: 'testSet', nodes: numNodes});
var nodes = replTest.startSet();
replTest.initiate();
@@ -23,10 +23,14 @@
jsTestLog("Invalid reconfig");
config.version++;
- var badMember = {_id: numNodes, host: "localhost:12345", priority: "High"};
+ var badMember = {
+ _id: numNodes,
+ host: "localhost:12345",
+ priority: "High"
+ };
config.members.push(badMember);
var invalidConfigCode = 93;
- assert.commandFailedWithCode(primary.adminCommand({replSetReconfig : config}),
+ assert.commandFailedWithCode(primary.adminCommand({replSetReconfig: config}),
invalidConfigCode);
jsTestLog("No force when needed.");
@@ -35,8 +39,7 @@
config.members[nodes.indexOf(secondary)].priority = 5;
var admin = secondary.getDB("admin");
var forceRequiredCode = 10107;
- assert.commandFailedWithCode(admin.runCommand({replSetReconfig: config}),
- forceRequiredCode);
+ assert.commandFailedWithCode(admin.runCommand({replSetReconfig: config}), forceRequiredCode);
jsTestLog("Force when appropriate");
assert.commandWorked(admin.runCommand({replSetReconfig: config, force: true}));