From 3fc9bc38c1fe6f07ea5a1c4982ff1ec630efd9bb Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Mon, 16 Dec 2024 15:35:10 -0500 Subject: [PATCH 1/2] test(transactions): add test case for #15094 --- test/docs/transactions.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/docs/transactions.test.js b/test/docs/transactions.test.js index 2a63f07a984..7e7c8629de7 100644 --- a/test/docs/transactions.test.js +++ b/test/docs/transactions.test.js @@ -399,6 +399,10 @@ describe('transactions', function() { let docs = await Test.aggregate([{ $match: { _id: doc._id } }]); assert.equal(docs.length, 1); + const aggCursor = TestModel.aggregate([{ $match: { _id: doc._id } }]).cursor(); + docs = [await aggCursor.next()]; + assert.equal(docs[0].name, 'test_transactionAsyncLocalStorage'); + docs = await Test.find({ _id: doc._id }); assert.equal(docs.length, 1); From 2b37dd6f7a527b4d7aacb8f23f68b0796d0f5a4f Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Mon, 16 Dec 2024 15:38:07 -0500 Subject: [PATCH 2/2] style: fix lint --- test/docs/transactions.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/docs/transactions.test.js b/test/docs/transactions.test.js index 7e7c8629de7..df16eaba91c 100644 --- a/test/docs/transactions.test.js +++ b/test/docs/transactions.test.js @@ -399,7 +399,7 @@ describe('transactions', function() { let docs = await Test.aggregate([{ $match: { _id: doc._id } }]); assert.equal(docs.length, 1); - const aggCursor = TestModel.aggregate([{ $match: { _id: doc._id } }]).cursor(); + const aggCursor = Test.aggregate([{ $match: { _id: doc._id } }]).cursor(); docs = [await aggCursor.next()]; assert.equal(docs[0].name, 'test_transactionAsyncLocalStorage');