From 510704685254cc78ac73f04287027b7604438d7d Mon Sep 17 00:00:00 2001 From: rochdev Date: Sat, 22 Jun 2024 12:39:01 -0400 Subject: [PATCH] fix express test --- .../sources/taint-tracking.express.plugin.spec.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.express.plugin.spec.js b/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.express.plugin.spec.js index 2684b567e14..7465f6b2408 100644 --- a/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.express.plugin.spec.js +++ b/packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.express.plugin.spec.js @@ -171,7 +171,9 @@ describe('Path params sourcing with express', () => { app.use('/:parameterParent', nestedRouter) - appListener = app.listen(0, 'localhost', port => { + appListener = app.listen(0, 'localhost', () => { + const port = appListener.address().port + axios .get(`http://localhost:${port}/tainted1/tainted2`) .then(() => done()) @@ -189,7 +191,9 @@ describe('Path params sourcing with express', () => { app.param('parameter1', checkParamIsTaintedAndNext) app.param('parameter2', checkParamIsTaintedAndNext) - appListener = app.listen(0, 'localhost', port => { + appListener = app.listen(0, 'localhost', () => { + const port = appListener.address().port + axios .get(`http://localhost:${port}/tainted1/tainted2`) .then(() => done()) @@ -211,7 +215,9 @@ describe('Path params sourcing with express', () => { app.param('parameter1') app.param('parameter2') - appListener = app.listen(0, 'localhost', port => { + appListener = app.listen(0, 'localhost', () => { + const port = appListener.address().port + axios .get(`http://localhost:${port}/tainted1/tainted2`) .then(() => done())