Skip to content

Commit

Permalink
Fix net plugin tests (#3906)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Belanger authored and khanayan123 committed Jan 4, 2024
1 parent fb3f858 commit 37f9bee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/datadog-plugin-net/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,14 @@ describe('Plugin', () => {
socket.destroy()

socket.once('close', () => {
expect(socket.eventNames()).to.not.include.members(events)
done()
setImmediate(() => {
// Node.js 21.2 broke this function. We'll have to do the more manual way for now.
// expect(socket.eventNames()).to.not.include.members(events)
for (const event of events) {
expect(socket.listeners(event)).to.have.lengthOf(0)
}
done()
})
})
})
})
Expand Down

0 comments on commit 37f9bee

Please sign in to comment.