Skip to content

Commit a1dbec0

Browse files
authored
test: improve documentation of default values in test agent (#6028)
1 parent f3da1ad commit a1dbec0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

packages/dd-trace/test/plugins/agent.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ module.exports = {
321321
* Load the plugin on the tracer with an optional config and start a mock agent.
322322
*
323323
* @param {String|Array<String>} pluginName - Name or list of names of plugins to load
324-
* @param {Record<string, unknown>} config
325-
* @param {Record<string, unknown>} tracerConfig
324+
* @param {Record<string, unknown>} [config]
325+
* @param {Record<string, unknown>} [tracerConfig={}]
326326
* @returns Promise<void>
327327
*/
328328
async load (pluginName, config, tracerConfig = {}) {
@@ -521,19 +521,18 @@ module.exports = {
521521

522522
/**
523523
* Stop the mock agent, reset all expectations and wipe the require cache.
524-
* @param {Object} opts
525-
* @param {boolean} opts.ritmReset - Resets the Require In The Middle cache. You probably don't need this.
526-
* @param {boolean} opts.wipe - Wipes tracer and non-native modules from require cache. You probably don't need this.
524+
* @param {Object} [options]
525+
* @param {boolean} [options.ritmReset=true] - Resets the Require In The Middle cache. You probably don't need this.
526+
* @param {boolean} [options.wipe=false] - Wipes tracer and non-native modules from require cache. You probably don't
527+
* need this.
527528
* @returns
528529
*/
529-
close (opts = {}) {
530+
close ({ ritmReset = true, wipe = false } = {}) {
530531
// Allow close to be called idempotent
531532
if (listener === null) {
532533
return Promise.resolve()
533534
}
534535

535-
const { ritmReset, wipe } = opts
536-
537536
listener.close()
538537
listener = null
539538
sockets.forEach(socket => socket.end())

0 commit comments

Comments
 (0)