Skip to content

Commit

Permalink
pg: update error string comparison in test (#3295)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlhunter committed Jun 30, 2023
1 parent d9bebfa commit 375c811
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/datadog-plugin-pg/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ describe('Plugin', () => {
agent.use(traces => {
expect(traces[0][0].meta).to.have.property(ERROR_TYPE, error.name)
expect(traces[0][0].meta).to.have.property(ERROR_MESSAGE, error.message)
expect(traces[0][0].meta).to.have.property(ERROR_STACK, error.stack)

// pg modifies stacktraces as of v8.11.1
const actualErrorNoStack = traces[0][0].meta[ERROR_STACK].split('\n')[0]
const expectedErrorNoStack = error.stack.split('\n')[0]
expect(actualErrorNoStack).to.eql(expectedErrorNoStack)

expect(traces[0][0].meta).to.have.property('component', 'pg')
expect(traces[0][0].metrics).to.have.property('network.destination.port', 5432)
})
Expand Down

0 comments on commit 375c811

Please sign in to comment.