Skip to content

Commit

Permalink
chore: cleaned up test name and added more assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
bizob2828 committed Jan 23, 2025
1 parent 1a49b00 commit c38a581
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/unit/shim/shim.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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' })
Expand All @@ -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()
})
})
Expand Down

0 comments on commit c38a581

Please sign in to comment.