From 75b2736c703fdfce5afb47df5851affb68a117fe Mon Sep 17 00:00:00 2001 From: Pranav Senthilnathan Date: Tue, 30 May 2023 19:02:02 -0700 Subject: [PATCH] fix angular test discovery (#2467) --- .../TestAdapter/TestFrameworks/Angular/karmaConfig.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Nodejs/Product/TestAdapter/TestFrameworks/Angular/karmaConfig.js b/Nodejs/Product/TestAdapter/TestFrameworks/Angular/karmaConfig.js index 084bf2c3e..509c327ad 100644 --- a/Nodejs/Product/TestAdapter/TestFrameworks/Angular/karmaConfig.js +++ b/Nodejs/Product/TestAdapter/TestFrameworks/Angular/karmaConfig.js @@ -19,6 +19,11 @@ module.exports = function (config) { // Replace all reporters config.reporters = ['vsKarmaReporter']; + if (!config.hostname && !config.listenAddress) { + // The default address is IPv4 but node 17+ uses IPv6. Update the value to 'localhost' (which works with both IPv4 and IPv6) if it was not set. + config.hostname = config.listenAddress = 'localhost'; + } + setGrep(config); };