From 29b2fa0483a9327785731add086c6f5e42e7f895 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Fri, 30 Oct 2026 10:24:34 -0500 Subject: [PATCH] test(metrics): read the content-type as string | string[] Core RC.1 widens response header values to string | string[] (core #113, a documented Breaking change for readers). The metrics test read the transformer's content-type as a string and fails to typecheck against the RC.1 candidate. Narrowing with String() also typechecks on 26.9.0-beta.2. Plugin source is unaffected. Signed-off-by: Diego Resendez --- packages/metrics/test/metrics.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/metrics/test/metrics.test.ts b/packages/metrics/test/metrics.test.ts index 174f6ac..4fbd76a 100644 --- a/packages/metrics/test/metrics.test.ts +++ b/packages/metrics/test/metrics.test.ts @@ -88,7 +88,8 @@ test('the transformer serves the text format with the content type Prometheus ex const rendered = prometheus('green_tea_requests_total{route="/x",method="GET",status="200"} 1\n'); assert.equal(rendered.status, 200); - assert.match(rendered.headers!['content-type'], /text\/plain/); + // Core RC.1 widens response header values to `string | string[]` (core #113), so a reader narrows. + assert.match(String(rendered.headers!['content-type']), /text\/plain/); assert.match(rendered.body, /green_tea_requests_total/); }); -- 2.54.1