Skip to content

Commit

Permalink
fix instrumenter signature
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Apr 15, 2024
1 parent 565cb2d commit fde7618
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/instrumentation/superagent.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const http = require('http')
const METHODS = http.METHODS.map((method) => method.toLowerCase())

module.exports = function instrument(shim, superagent) {
module.exports = function instrument(agent, superagent, moduleName, shim) {
shim.wrapExport(superagent, function wrapRequest(shim, request) {
if (!shim.isFunction(request)) {
shim.logger.debug('Not wrapping export, expected a function.')
Expand Down
2 changes: 1 addition & 1 deletion test/unit/instrumentation/superagent/superagent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tap.test('should not wrap superagent if it is not a function', (t) => {
api.shim.logger.debug = sinon.stub()
const instrumentation = require('../../../../lib/instrumentation/superagent')
const superagentMock = { foo: 'bar' }
instrumentation(api.shim, superagentMock)
instrumentation(t.context.agent, superagentMock, 'superagent', api.shim)
t.equal(api.shim.logger.debug.callCount, 1, 'should call debug logger')
t.equal(api.shim.logger.debug.args[0][0], 'Not wrapping export, expected a function.')
t.end()
Expand Down

0 comments on commit fde7618

Please sign in to comment.