• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ringcentral / google-forms-notification-add-in / 9791291178

04 Jul 2024 08:46AM UTC coverage: 95.292% (+0.05%) from 95.238%
9791291178

Pull #67

github

web-flow
Merge eb2f5d0ea into 7dde406c7
Pull Request #67: misc: filter data in logs

247 of 272 branches covered (90.81%)

Branch coverage included in aggregate %.

41 of 46 new or added lines in 9 files covered. (89.13%)

684 of 705 relevant lines covered (97.02%)

14.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

48.0
/src/server/lib/analytics.js
1
const Mixpanel = require('mixpanel');
4✔
2
const { errorLogger } = require('./logger');
4✔
3

4
class Analytics {
5
  constructor({
6
    mixpanelKey,
7
    appName = 'Google Forms Add-in',
11✔
8
  }) {
9
    if (mixpanelKey) {
11!
10
      this._mixpanel = Mixpanel.init(mixpanelKey);
×
11
    }
12
    this._appName = appName;
11✔
13
  }
14

15
  _track(event, properties = {}) {
×
16
    if (!this._mixpanel) {
11!
17
      return Promise.resolve();
11✔
18
    }
19
    return new Promise((resolve, reject) => {
×
20
      this._mixpanel.track(event, {
×
21
        appName: this._appName,
22
        ...properties,
23
      }, (err) => {
24
        if (err) {
×
25
          reject(err);
×
26
        } else {
27
          resolve();
×
28
        }
29
      });
30
    });
31
  }
32

33
  async track(event, properties = {}) {
×
34
    try {
11✔
35
      await this._track(event, properties);
11✔
36
    } catch (e) {
NEW
37
      errorLogger(e);
×
38
    }
39
  }
40
}
41

42
exports.Analytics = Analytics;
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc