summaryrefslogtreecommitdiff
path: root/jstests/sharding/sharding_test_options_immutable.js
blob: fb904afe6ace077b8c8c1a483c256a9b10b19274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Ensure options object passed to ShardingTest is not mutated.
 */

(function() {
'use strict';

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: {}});
}
})();