From cd6912911cbcd8142902636a6d7ba3eb7cab55df Mon Sep 17 00:00:00 2001 From: Pranav Senthilnathan Date: Mon, 29 May 2023 14:32:25 -0700 Subject: [PATCH] fix angular test discovery --- .../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); };