Skip to content

Commit dc47eb9

Browse files
committed
Fix tests
1 parent 5172108 commit dc47eb9

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

packages/core/src/carrier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type VersionedCarrier = {
1919
/**
2020
* IMPORTANT - This must be updated if any breaking changes are made to the 'SentryCarrier' interface.
2121
*/
22-
const CARRIER_VERSION = '9';
22+
export const CARRIER_VERSION = '9';
2323

2424
export interface SentryCarrier {
2525
acs?: AsyncContextStrategy;

packages/core/test/lib/carrier.test.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getSentryCarrier } from '../../src/carrier';
2-
import { SDK_VERSION } from '../../src/utils-hoist/version';
2+
import { CARRIER_VERSION } from '../../src/carrier';
33

44
describe('getSentryCarrier', () => {
55
describe('base case (one SDK)', () => {
@@ -11,17 +11,17 @@ describe('getSentryCarrier', () => {
1111

1212
expect(globalObject).toEqual({
1313
__SENTRY__: {
14-
version: SDK_VERSION,
15-
[SDK_VERSION]: {},
14+
version: CARRIER_VERSION,
15+
[CARRIER_VERSION]: {},
1616
},
1717
});
1818
});
1919

2020
it('returns the existing sentry carrier object if it already exists', () => {
2121
const originalGlobalObject = {
2222
__SENTRY__: {
23-
version: SDK_VERSION,
24-
[SDK_VERSION]: {
23+
version: CARRIER_VERSION,
24+
[CARRIER_VERSION]: {
2525
acs: {},
2626
},
2727
},
@@ -42,13 +42,14 @@ describe('getSentryCarrier', () => {
4242
describe('multiple (older) SDKs', () => {
4343
it("returns the version of the sentry carrier object of the SDK's version rather than the one set in .version", () => {
4444
const sentryCarrier = getSentryCarrier({
45-
// @ts-expect-error - this is just a test object
4645
__SENTRY__: {
4746
version: '8.0.0', // another SDK set this
4847
'8.0.0': {
48+
// @ts-expect-error - this is just a test object
4949
stack: {},
5050
},
51-
[SDK_VERSION]: {
51+
[CARRIER_VERSION]: {
52+
// @ts-expect-error - this is just a test object
5253
acs: {},
5354
},
5455
hub: {},
@@ -82,7 +83,7 @@ describe('getSentryCarrier', () => {
8283
'8.0.0': {
8384
acs: {},
8485
},
85-
[SDK_VERSION]: {},
86+
[CARRIER_VERSION]: {},
8687
},
8788
});
8889
});

0 commit comments

Comments
 (0)