Skip to content

Commit

Permalink
style: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Aug 12, 2023
1 parent 1d9557a commit 19adb07
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/docs/transactions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,11 @@ describe('transactions', function() {

await Test.createCollection();
await Test.deleteMany({});

const doc = new Test({ name: 'test' });
assert.ok(doc.$isNew);
await assert.rejects(
db.transaction(async (session) => {
db.transaction(async(session) => {
await doc.save({ session });
throw new Error('Oops!');
}),
Expand All @@ -378,20 +378,20 @@ describe('transactions', function() {

await Test.createCollection();
await Test.deleteMany({});

const doc = new Test({ name: 'test' });
assert.ok(doc.$isNew);
let retryCount = 0;
await db.transaction(async (session) => {
await db.transaction(async(session) => {
assert.ok(doc.$isNew);
await doc.save({ session });
if (++retryCount < 3) {
throw new mongoose.mongo.MongoServerError({
errorLabels: ["TransientTransactionError"],
errorLabels: ['TransientTransactionError']
});
}
});

const docs = await Test.find();
assert.equal(docs.length, 1);
assert.equal(docs[0].name, 'test');
Expand Down

0 comments on commit 19adb07

Please sign in to comment.