Skip to content

Commit

Permalink
Analytics formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehesp committed Aug 21, 2019
1 parent 24be224 commit c36ccbb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 0 additions & 2 deletions packages/admob/lib/AdsConsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ export default {
return native.getStatus();
},

// TODO getStatus

/**
*
* @param status
Expand Down
10 changes: 6 additions & 4 deletions packages/analytics/e2e/analytics.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ describe('analytics()', () => {
firebase.analytics().logEvent('session_start');
return Promise.reject(new Error('Did not throw.'));
} catch (e) {
e.message.should.containEql(`'name' the event name 'session_start' is reserved and can not be used`);
e.message.should.containEql(
`'name' the event name 'session_start' is reserved and can not be used`,
);
return Promise.resolve();
}
});
Expand Down Expand Up @@ -115,7 +117,7 @@ describe('analytics()', () => {
foo: 'bar',
bar: {
baz: 123,
}
},
});
return Promise.reject(new Error('Did not throw.'));
} catch (e) {
Expand Down Expand Up @@ -309,8 +311,8 @@ describe('analytics()', () => {
await firebase.analytics().setUserProperties({
test: 123,
foo: {
bar: 'baz'
}
bar: 'baz',
},
});
return Promise.reject(new Error('Did not throw.'));
} catch (e) {
Expand Down
16 changes: 8 additions & 8 deletions packages/analytics/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,19 @@ class FirebaseAnalyticsModule extends FirebaseModule {

setAnalyticsCollectionEnabled(enabled) {
if (!isBoolean(enabled)) {
throw new Error("firebase.analytics().setAnalyticsCollectionEnabled(*) 'enabled' expected a boolean value.");
throw new Error(
"firebase.analytics().setAnalyticsCollectionEnabled(*) 'enabled' expected a boolean value.",
);
}

return this.native.setAnalyticsCollectionEnabled(enabled);
}

setCurrentScreen(screenName, screenClassOverride) {
if (!isString(screenName)) {
throw new Error("firebase.analytics().setCurrentScreen(*) 'screenName' expected a string value.");
throw new Error(
"firebase.analytics().setCurrentScreen(*) 'screenName' expected a string value.",
);
}

if (!isUndefined(screenClassOverride) && !isString(screenClassOverride)) {
Expand Down Expand Up @@ -154,19 +158,15 @@ class FirebaseAnalyticsModule extends FirebaseModule {

setUserId(id) {
if (!isNull(id) && !isString(id)) {
throw new Error(
"firebase.analytics().setUserId(*) 'id' expected a string value.",
);
throw new Error("firebase.analytics().setUserId(*) 'id' expected a string value.");
}

return this.native.setUserId(id);
}

setUserProperty(name, value) {
if (!isString(name)) {
throw new Error(
"firebase.analytics().setUserProperty(*) 'name' expected a string value.",
);
throw new Error("firebase.analytics().setUserProperty(*) 'name' expected a string value.");
}

if (value !== null && !isString(value)) {
Expand Down

0 comments on commit c36ccbb

Please sign in to comment.