diff --git a/packages/core/src/carrier.ts b/packages/core/src/carrier.ts index ebdfd8945b66..4ecd8838fec8 100644 --- a/packages/core/src/carrier.ts +++ b/packages/core/src/carrier.ts @@ -19,7 +19,7 @@ type VersionedCarrier = { /** * IMPORTANT - This must be updated if any breaking changes are made to the 'SentryCarrier' interface. */ -const CARRIER_VERSION = '9'; +export const CARRIER_VERSION = '9'; export interface SentryCarrier { acs?: AsyncContextStrategy; diff --git a/packages/core/test/lib/carrier.test.ts b/packages/core/test/lib/carrier.test.ts index 19ebc8117ca4..f3fbacef37ed 100644 --- a/packages/core/test/lib/carrier.test.ts +++ b/packages/core/test/lib/carrier.test.ts @@ -1,5 +1,5 @@ import { getSentryCarrier } from '../../src/carrier'; -import { SDK_VERSION } from '../../src/utils-hoist/version'; +import { CARRIER_VERSION } from '../../src/carrier'; describe('getSentryCarrier', () => { describe('base case (one SDK)', () => { @@ -11,8 +11,8 @@ describe('getSentryCarrier', () => { expect(globalObject).toEqual({ __SENTRY__: { - version: SDK_VERSION, - [SDK_VERSION]: {}, + version: CARRIER_VERSION, + [CARRIER_VERSION]: {}, }, }); }); @@ -20,8 +20,8 @@ describe('getSentryCarrier', () => { it('returns the existing sentry carrier object if it already exists', () => { const originalGlobalObject = { __SENTRY__: { - version: SDK_VERSION, - [SDK_VERSION]: { + version: CARRIER_VERSION, + [CARRIER_VERSION]: { acs: {}, }, }, @@ -42,13 +42,14 @@ describe('getSentryCarrier', () => { describe('multiple (older) SDKs', () => { it("returns the version of the sentry carrier object of the SDK's version rather than the one set in .version", () => { const sentryCarrier = getSentryCarrier({ - // @ts-expect-error - this is just a test object __SENTRY__: { version: '8.0.0', // another SDK set this '8.0.0': { + // @ts-expect-error - this is just a test object stack: {}, }, - [SDK_VERSION]: { + [CARRIER_VERSION]: { + // @ts-expect-error - this is just a test object acs: {}, }, hub: {}, @@ -82,7 +83,7 @@ describe('getSentryCarrier', () => { '8.0.0': { acs: {}, }, - [SDK_VERSION]: {}, + [CARRIER_VERSION]: {}, }, }); });