diff --git a/lib/instrumentation/superagent.js b/lib/instrumentation/superagent.js index 95f73833ee..0d4560668f 100644 --- a/lib/instrumentation/superagent.js +++ b/lib/instrumentation/superagent.js @@ -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.') diff --git a/test/unit/instrumentation/superagent/superagent.test.js b/test/unit/instrumentation/superagent/superagent.test.js index 7fb82e291f..c03eb6e7f4 100644 --- a/test/unit/instrumentation/superagent/superagent.test.js +++ b/test/unit/instrumentation/superagent/superagent.test.js @@ -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()