From 7a40f36e7971f5cef22626e3029980eec1c20641 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Mon, 8 Jun 2020 18:16:49 +0200 Subject: [PATCH] test: Check for specific values in auth header (#2657) The tests changed in 8958f61ca6663122094e1991c37a63dcf771b5cf and then partly reverted in 9c525ff277f0a18bd0bd63a30f5b762f6b37f0f8. This commit brings back the original checks. --- packages/node/test/transports/http.test.ts | 4 +++- packages/node/test/transports/https.test.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/node/test/transports/http.test.ts b/packages/node/test/transports/http.test.ts index b5c2a085895b..6f602d8b2ca6 100644 --- a/packages/node/test/transports/http.test.ts +++ b/packages/node/test/transports/http.test.ts @@ -28,7 +28,9 @@ function createTransport(options: TransportOptions): HTTPTransport { } function assertBasicOptions(options: any): void { - expect(options.headers['X-Sentry-Auth']).toBeTruthy(); + expect(options.headers['X-Sentry-Auth']).toContain('sentry_version'); + expect(options.headers['X-Sentry-Auth']).toContain('sentry_client'); + expect(options.headers['X-Sentry-Auth']).toContain('sentry_key'); expect(options.port).toEqual('8989'); expect(options.path).toEqual(transportPath); expect(options.hostname).toEqual('sentry.io'); diff --git a/packages/node/test/transports/https.test.ts b/packages/node/test/transports/https.test.ts index 5788b03e4e5d..d007bc5999f8 100644 --- a/packages/node/test/transports/https.test.ts +++ b/packages/node/test/transports/https.test.ts @@ -34,7 +34,9 @@ function createTransport(options: TransportOptions): HTTPSTransport { } function assertBasicOptions(options: any): void { - expect(options.headers['X-Sentry-Auth']).toBeTruthy(); + expect(options.headers['X-Sentry-Auth']).toContain('sentry_version'); + expect(options.headers['X-Sentry-Auth']).toContain('sentry_client'); + expect(options.headers['X-Sentry-Auth']).toContain('sentry_key'); expect(options.port).toEqual('8989'); expect(options.path).toEqual(transportPath); expect(options.hostname).toEqual('sentry.io');