From 1706ac5049e4f710d50dcfc085665a636b7efb46 Mon Sep 17 00:00:00 2001 From: Niall Brennan Date: Tue, 22 Oct 2024 19:16:14 +0100 Subject: [PATCH] fix: update library name to match 1.x library name in context (#1014) * fix library name --- examples/E2E/e2e/main.e2e.js | 2 +- packages/core/src/__tests__/context.test.ts | 2 +- packages/core/src/context.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/E2E/e2e/main.e2e.js b/examples/E2E/e2e/main.e2e.js index 45030d28..1d05c599 100644 --- a/examples/E2E/e2e/main.e2e.js +++ b/examples/E2E/e2e/main.e2e.js @@ -147,7 +147,7 @@ describe('#mainTest', () => { expect(request.batch).toHaveLength(1); expect(context.app.name).toBe('AnalyticsReactNativeE2E'); expect(context.app.version).toBe('1.0'); - expect(context.library.name).toBe('@segment/analytics-react-native'); + expect(context.library.name).toBe('analytics-react-native'); expect(context.locale).toBe('en-US'); // This test only works in iOS for now if (device.getPlatform() === 'ios') { diff --git a/packages/core/src/__tests__/context.test.ts b/packages/core/src/__tests__/context.test.ts index 1cd2f489..30131122 100644 --- a/packages/core/src/__tests__/context.test.ts +++ b/packages/core/src/__tests__/context.test.ts @@ -48,7 +48,7 @@ describe('#getContext', () => { type: 'phone', }, library: { - name: packageJson.name, + name: 'analytics-react-native', version: packageJson.version, }, locale: 'en_US', diff --git a/packages/core/src/context.ts b/packages/core/src/context.ts index 0d374f5c..3115e7cd 100644 --- a/packages/core/src/context.ts +++ b/packages/core/src/context.ts @@ -83,7 +83,7 @@ export const getContext = async ( }, device, library: { - name: libraryInfo.name, + name: 'analytics-react-native', version: libraryInfo.version, }, locale,