summaryrefslogtreecommitdiff
path: root/jstests/libs/override_methods/detect_spawning_own_mongod.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/libs/override_methods/detect_spawning_own_mongod.js')
-rw-r--r--jstests/libs/override_methods/detect_spawning_own_mongod.js58
1 files changed, 28 insertions, 30 deletions
diff --git a/jstests/libs/override_methods/detect_spawning_own_mongod.js b/jstests/libs/override_methods/detect_spawning_own_mongod.js
index f741c086cdd..42b95a58d51 100644
--- a/jstests/libs/override_methods/detect_spawning_own_mongod.js
+++ b/jstests/libs/override_methods/detect_spawning_own_mongod.js
@@ -3,40 +3,38 @@
* suites should not contain JS tests that start their own mongod/s.
*/
(function() {
- 'use strict';
+'use strict';
- MongoRunner.runMongod = function() {
- throw new Error(
- "Detected MongoRunner.runMongod() call in js test from passthrough suite. " +
- "Consider moving the test to one of the jstests/noPassthrough/, " +
- "jstests/replsets/, or jstests/sharding/ directories.");
- };
+MongoRunner.runMongod = function() {
+ throw new Error("Detected MongoRunner.runMongod() call in js test from passthrough suite. " +
+ "Consider moving the test to one of the jstests/noPassthrough/, " +
+ "jstests/replsets/, or jstests/sharding/ directories.");
+};
- MongoRunner.runMongos = function() {
- throw new Error(
- "Detected MongoRunner.runMongos() call in js test from passthrough suite. " +
- "Consider moving the test to one of the jstests/noPassthrough/, " +
- "jstests/replsets/, or jstests/sharding/ directories.");
- };
+MongoRunner.runMongos = function() {
+ throw new Error("Detected MongoRunner.runMongos() call in js test from passthrough suite. " +
+ "Consider moving the test to one of the jstests/noPassthrough/, " +
+ "jstests/replsets/, or jstests/sharding/ directories.");
+};
- const STOverrideConstructor = function() {
- throw new Error("Detected ShardingTest() call in js test from passthrough suite. " +
- "Consider moving the test to one of the jstests/noPassthrough/, " +
- "jstests/replsets/, or jstests/sharding/ directories.");
- };
+const STOverrideConstructor = function() {
+ throw new Error("Detected ShardingTest() call in js test from passthrough suite. " +
+ "Consider moving the test to one of the jstests/noPassthrough/, " +
+ "jstests/replsets/, or jstests/sharding/ directories.");
+};
- // This Object.assign() lets us modify ShardingTest to use the new overridden constructor but
- // still keep any static properties it has.
- ShardingTest = Object.assign(STOverrideConstructor, ShardingTest);
+// This Object.assign() lets us modify ShardingTest to use the new overridden constructor but
+// still keep any static properties it has.
+ShardingTest = Object.assign(STOverrideConstructor, ShardingTest);
- const RSTOverrideConstructor = function() {
- throw new Error("Detected ReplSetTest() call in js test from passthrough suite. " +
- "Consider moving the test to one of the jstests/noPassthrough/, " +
- "jstests/replsets/, or jstests/sharding/ directories.");
- };
+const RSTOverrideConstructor = function() {
+ throw new Error("Detected ReplSetTest() call in js test from passthrough suite. " +
+ "Consider moving the test to one of the jstests/noPassthrough/, " +
+ "jstests/replsets/, or jstests/sharding/ directories.");
+};
- // Same as the above Object.assign() call. In particular, we want to preserve the
- // ReplSetTest.kDefaultTimeoutMS property, which should be accessible to tests in the
- // passthrough suite.
- ReplSetTest = Object.assign(RSTOverrideConstructor, ReplSetTest);
+// Same as the above Object.assign() call. In particular, we want to preserve the
+// ReplSetTest.kDefaultTimeoutMS property, which should be accessible to tests in the
+// passthrough suite.
+ReplSetTest = Object.assign(RSTOverrideConstructor, ReplSetTest);
})();