diff options
Diffstat (limited to 'jstests/noPassthrough/session_w0.js')
-rw-r--r-- | jstests/noPassthrough/session_w0.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/jstests/noPassthrough/session_w0.js b/jstests/noPassthrough/session_w0.js index dd219581f43..5f6f29c0ec8 100644 --- a/jstests/noPassthrough/session_w0.js +++ b/jstests/noPassthrough/session_w0.js @@ -2,19 +2,18 @@ * Explicit shell session should prohibit w: 0 writes. */ (function() { - "use strict"; +"use strict"; - const conn = MongoRunner.runMongod(); - const session = conn.startSession(); - const sessionColl = session.getDatabase("test").getCollection("foo"); - const err = assert.throws(() => { - sessionColl.insert({x: 1}, {writeConcern: {w: 0}}); - }); +const conn = MongoRunner.runMongod(); +const session = conn.startSession(); +const sessionColl = session.getDatabase("test").getCollection("foo"); +const err = assert.throws(() => { + sessionColl.insert({x: 1}, {writeConcern: {w: 0}}); +}); - assert.includes(err.toString(), - "Unacknowledged writes are prohibited with sessions", - "wrong error message"); +assert.includes( + err.toString(), "Unacknowledged writes are prohibited with sessions", "wrong error message"); - session.endSession(); - MongoRunner.stopMongod(conn); +session.endSession(); +MongoRunner.stopMongod(conn); })(); |