From 9d62673d2c3223243c6d18af6ddcf7b233264b50 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Wed, 15 Nov 2023 15:40:24 -0500 Subject: [PATCH] Fix prom test for node 20 --- .../test/PrometheusExporter.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts b/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts index b4c6f0ade0..1030203a2c 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts +++ b/experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusExporter.test.ts @@ -360,8 +360,8 @@ describe('PrometheusExporter', () => { .get('http://localhost:9464/metrics', res => { errorHandler(done)(new Error('unreachable')); }) - .on('error', err => { - assert(`${err}`.match('ECONNREFUSED')); + .on('error', (err: any) => { + assert.equal(err.code, 'ECONNREFUSED'); done(); }); });