Skip to content

Commit de534a4

Browse files
committed
remove unnecessary logging
1 parent 04499fa commit de534a4

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

src/integrationTests/autoRefresh.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ let getAdvertisingTokenPromise: Promise<string | undefined>;
1111

1212
mocks.setupFakeTime();
1313

14+
beforeAll(() => {
15+
mocks.setWarnMock();
16+
});
17+
18+
afterAll(() => {
19+
mocks.clearWarnMock();
20+
});
21+
1422
beforeEach(() => {
1523
callback = jest.fn();
1624
uid2 = new UID2();

src/integrationTests/basic.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ let xhrMock: any;
1010

1111
mocks.setupFakeTime();
1212

13+
beforeAll(() => {
14+
mocks.setWarnMock();
15+
});
16+
17+
afterAll(() => {
18+
mocks.clearWarnMock();
19+
});
20+
1321
beforeEach(() => {
1422
callback = jest.fn();
1523
uid2 = new UID2();
@@ -1011,7 +1019,7 @@ describe('SDK bootstraps itself if init has already been completed', () => {
10111019
sdkWindow.__uid2 = new UID2();
10121020
});
10131021

1014-
test('should bootstrap therefore public functions should return the correct values without calling init again', async () => {
1022+
test.only('should bootstrap therefore public functions should return the correct values without calling init again', async () => {
10151023
const identity = { ...makeIdentity(), refresh_from: Date.now() + 100 };
10161024

10171025
uid2.init({ identity });
@@ -1027,13 +1035,13 @@ describe('SDK bootstraps itself if init has already been completed', () => {
10271035
await uid2.setIdentityFromEmail(email, mocks.makeUid2CstgOption());
10281036
}).not.toThrow();
10291037
expect(async () => {
1030-
uid2.setIdentityFromEmailHash(emailHash, mocks.makeUid2CstgOption());
1038+
await uid2.setIdentityFromEmailHash(emailHash, mocks.makeUid2CstgOption());
10311039
}).not.toThrow();
10321040
expect(async () => {
10331041
await uid2.setIdentityFromPhone(phone, mocks.makeUid2CstgOption());
10341042
}).not.toThrow();
10351043
expect(async () => {
1036-
uid2.setIdentityFromPhoneHash(phoneHash, mocks.makeUid2CstgOption());
1044+
await uid2.setIdentityFromPhoneHash(phoneHash, mocks.makeUid2CstgOption());
10371045
}).not.toThrow();
10381046
});
10391047

src/integrationTests/compatibility.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ let xhrMock: any;
99

1010
mocks.setupFakeTime();
1111

12+
beforeAll(() => {
13+
mocks.setWarnMock();
14+
});
15+
16+
afterAll(() => {
17+
mocks.clearWarnMock();
18+
});
19+
1220
beforeEach(() => {
1321
callback = jest.fn();
1422
uid2 = new UID2();

src/sdkBase.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export abstract class SdkBase {
102102
}
103103

104104
public async setIdentityFromEmail(email: string, opts: ClientSideIdentityOptions) {
105-
this._logger.log('Sending request', email);
106105
this.throwIfInitNotComplete('Cannot set identity before calling init.');
107106
isClientSideIdentityOptionsOrThrow(opts, this._product.name);
108107

@@ -225,12 +224,10 @@ export abstract class SdkBase {
225224

226225
if (opts.baseUrl && opts.baseUrl !== previousOpts.baseUrl) {
227226
this._apiClient?.updateBaseUrl(opts.baseUrl);
228-
this._logger.log('BaseUrl updated for ApiClient');
229227
}
230228

231229
if (opts.callback && opts.callback !== previousOpts.callback) {
232230
this._initCallbackManager?.addInitCallback(opts.callback);
233-
this._logger.log('init callback added to list');
234231
}
235232

236233
const useNewIdentity =
@@ -246,7 +243,6 @@ export abstract class SdkBase {
246243

247244
if (opts.refreshRetryPeriod && previousOpts.refreshRetryPeriod !== opts.refreshRetryPeriod) {
248245
this.setRefreshTimer();
249-
this._logger.log('new refresh period set and refresh timer set');
250246
}
251247

252248
updateConfig(this._opts, this._product, previousOpts);

0 commit comments

Comments
 (0)