0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-24 00:17:37 +01:00
mongodb/jstests/sharding/sharding_test_options_immutable.js
Matt Broadstone 771dabd098 SERVER-81339 Convert ReplSetTest and ShardingTest to modules (#26332)
GitOrigin-RevId: 744aa110a53786b23c62ff53f87a1418b5991e8d
2024-08-20 22:00:49 +00:00

23 lines
464 B
JavaScript

/*
* Ensure options object passed to ShardingTest is not mutated.
*/
import {ShardingTest} from "jstests/libs/shardingtest.js";
const opts = {
setParameter: {},
};
try {
const st = new ShardingTest({
mongos: [opts],
config: [opts],
rs: {nodes: [opts]},
shards: 1,
});
st.stop();
} catch (e) {
assert(false, `ShardingTest threw an error: ${tojson(e)}`);
} finally {
assert.eq(opts, {setParameter: {}});
}