Skip to content

Commit f4f7ce2

Browse files
author
Athira M
committed
Fix yarn format errors
1 parent 6be23df commit f4f7ce2

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

packages/remote-config/src/abt/experiment.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ export class Experiment {
5252
): void {
5353
for (const [experimentId, experimentInfo] of experimentInfoMap.entries()) {
5454
if (!currentActiveExperiments.has(experimentId)) {
55-
this.addExperimentToAnalytics(experimentId, experimentInfo.variantId);
55+
void this.addExperimentToAnalytics(
56+
experimentId,
57+
experimentInfo.variantId
58+
);
5659
}
5760
}
5861
}
@@ -63,23 +66,25 @@ export class Experiment {
6366
): void {
6467
for (const experimentId of currentActiveExperiments) {
6568
if (!experimentInfoMap.has(experimentId)) {
66-
this.removeExperimentFromAnalytics(experimentId);
69+
void this.removeExperimentFromAnalytics(experimentId);
6770
}
6871
}
6972
}
7073

7174
private async addExperimentToAnalytics(
7275
experimentId: string,
73-
variantId: string|null
76+
variantId: string | null
7477
): Promise<void> {
7578
const analytics = await this.analyticsProvider.get();
7679
const customProperty = {
77-
[experimentId]: variantId,
80+
[experimentId]: variantId
7881
};
79-
analytics.setUserProperties({properties: customProperty});
82+
analytics.setUserProperties({ properties: customProperty });
8083
}
8184

82-
private async removeExperimentFromAnalytics(experimentId: string): Promise<void> {
83-
this.addExperimentToAnalytics(experimentId, null);
85+
private async removeExperimentFromAnalytics(
86+
experimentId: string
87+
): Promise<void> {
88+
void this.addExperimentToAnalytics(experimentId, null);
8489
}
8590
}

packages/remote-config/test/abt/experiment.test.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ describe('Experiment', () => {
3232
beforeEach(() => {
3333
storage.getActiveExperiments = sinon.stub();
3434
storage.setActiveExperiments = sinon.stub();
35-
analyticsProvider.get = sinon.stub().returns(Promise.resolve({
36-
setUserProperties: sinon.stub()
37-
}));
35+
analyticsProvider.get = sinon.stub().returns(
36+
Promise.resolve({
37+
setUserProperties: sinon.stub()
38+
})
39+
);
3840
});
3941

4042
it('adds mew experiments to storage', async () => {
@@ -72,7 +74,9 @@ describe('Experiment', () => {
7274
expect(storage.setActiveExperiments).to.have.been.calledWith(
7375
expectedStoredExperiments
7476
);
75-
expect(analytics.setUserProperties).to.have.been.calledWith({properties: {'_exp_1': '1'}});
77+
expect(analytics.setUserProperties).to.have.been.calledWith({
78+
properties: { '_exp_1': '1' }
79+
});
7680
});
7781

7882
it('removes missing experiment in fetch response from storage', async () => {
@@ -96,7 +100,9 @@ describe('Experiment', () => {
96100
expect(storage.setActiveExperiments).to.have.been.calledWith(
97101
expectedStoredExperiments
98102
);
99-
expect(analytics.setUserProperties).to.have.been.calledWith({properties: {'_exp_1': null}});
103+
expect(analytics.setUserProperties).to.have.been.calledWith({
104+
properties: { '_exp_1': null }
105+
});
100106
});
101107
});
102108
});

packages/remote-config/test/remote_config.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ describe('RemoteConfig', () => {
7575
let rc: RemoteConfigType;
7676
let analyticsProvider: Provider<FirebaseAnalyticsInternalName>;
7777

78-
7978
let getActiveConfigStub: sinon.SinonStub;
8079
let loggerDebugSpy: sinon.SinonSpy;
8180
let loggerLogLevelSpy: any;

0 commit comments

Comments
 (0)