diff --git a/functional_tests/identify.test.ts b/functional_tests/identify.test.ts index d9f95d587..0d864201f 100644 --- a/functional_tests/identify.test.ts +++ b/functional_tests/identify.test.ts @@ -1,10 +1,11 @@ -import 'regenerator-runtime/runtime' import { waitFor } from '@testing-library/dom' import { v4 } from 'uuid' import { getRequests } from './mock-server' import { createPosthogInstance } from './posthog-instance' import { logger } from '../src/utils/logger' + jest.mock('../src/utils/logger') + test('identify sends a identify event', async () => { const token = v4() const posthog = await createPosthogInstance(token) @@ -29,7 +30,7 @@ test('identify sends a identify event', async () => { }) test('identify sends an engage request if identify called twice with the same distinct id and with $set/$set_once', async () => { - // The intention here is to reduce the number of unncecessary $identify + // The intention here is to reduce the number of unnecessary $identify // requests to process. const token = v4() const posthog = await createPosthogInstance(token) diff --git a/src/posthog-core.ts b/src/posthog-core.ts index fa43907db..ce30edf80 100644 --- a/src/posthog-core.ts +++ b/src/posthog-core.ts @@ -1302,8 +1302,10 @@ export class PostHog { return logger.uninitializedWarning('posthog.identify') } if (_isNumber(new_distinct_id)) { - logger.error('The first argument to posthog.identify was a number, but it should be a string.') new_distinct_id = (new_distinct_id as number).toString() + logger.warn( + 'The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.' + ) } //if the new_distinct_id has not been set ignore the identify event