From c38a5810bdc4e00059e8405e20999b4bad397358 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Thu, 23 Jan 2025 12:47:15 -0500 Subject: [PATCH] chore: cleaned up test name and added more assertions --- test/unit/shim/shim.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/unit/shim/shim.test.js b/test/unit/shim/shim.test.js index cc08e0caa6..45a17481a8 100644 --- a/test/unit/shim/shim.test.js +++ b/test/unit/shim/shim.test.js @@ -1609,7 +1609,7 @@ test('Shim', async function (t) { }) }) - await t.test('#record wrapper when called with an inactive transaction', async function (t) { + await t.test('#record wrapper should not create a new segment when called with an inactive transaction', async function (t) { t.beforeEach(beforeEach) t.afterEach(afterEach) await t.test('should not create a segment', function (t, end) { @@ -1627,7 +1627,7 @@ test('Shim', async function (t) { }) }) - await t.test('should not create a segment', function (t, end) { + await t.test('#record wrapper should not create a new segment when there is no current active segment', function (t, end) { const { agent, shim, wrappable } = t.nr shim.record(wrappable, 'getActiveSegment', function () { return new RecorderSpec({ name: 'test segment' }) @@ -1637,6 +1637,8 @@ test('Shim', async function (t) { shim.setActiveSegment(null) const segment = wrappable.getActiveSegment() assert.equal(segment, null) + tx.end() + assert.equal(tx.isActive(), false) end() }) })