mongo/jstests/sharding/sharding_test_options_immutable.js
Zac 591928c619 SERVER-108478 JS formatted by prettier and remove clang-format (#39656)
GitOrigin-RevId: 6c8f6aded47f260aa4f7c231b17dae3302cb1e04
2025-08-21 17:27:09 +00:00

24 lines
465 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: {}});
}