New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

electron-google-analytics

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-google-analytics - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

.travis.yml

7

package.json
{
"name": "electron-google-analytics",
"version": "0.0.3",
"version": "0.0.4",
"description": "A library to implement Google Analytics in desktop apps.",
"main": "src/index.js",
"main": "lib/index.js",
"scripts": {
"build": "babel src -d lib",
"test": "mocha --compilers js:babel-register"
"test": "cross-env NODE_ENV=test mocha --compilers js:babel-register"
},

@@ -24,2 +24,3 @@ "keywords": [

"babel-core": "^6.22.1",
"babel-preset-env": "^1.1.8",
"babel-register": "^6.22.0",

@@ -26,0 +27,0 @@ "chai": "^3.5.0",

@@ -5,41 +5,57 @@ import chai from 'chai';

const expect = chai.expect;
const trackingID = process.env.TRACKING_ID;
const trackingID = (process.env.TRACKING_ID) ? process.env.TRACKING_ID : '';
describe('Analytics', function() {
it('should fail sending a pageview request', function() {
const analytics = new Analytics('', { debug: true });
return analytics.pageview('http://example.com', 'test', 'test')
.then((response) => {
return expect(response).to.be.empty;
}).catch((err) => {
return expect(err).to.not.be.empty;
if (trackingID) {
it('should send a pageview request', function() {
const analytics = new Analytics(trackingID, { debug: true });
return analytics.pageview('http://example.com', '/test', 'Test')
.then((response) => {
return expect(response).to.have.property('clientID');
}).catch((err) => {
return expect(err).to.be.empty;
});
});
});
it('should send a pageview request', function() {
const analytics = new Analytics(trackingID, { debug: true });
it('should send a event request', function() {
const analytics = new Analytics(trackingID, { debug: true });
return analytics.pageview('http://example.com', '/test', 'Test')
.then((response) => {
return expect(response).to.have.property('clientID');
}).catch((err) => {
return expect(err).to.be.empty;
return analytics.event('category', 'view').then((response) => {
return expect(response).to.have.property('clientID');
}).catch((err) => {
return expect(err).to.be.empty;
});
});
});
it('should send a event request', function() {
const analytics = new Analytics(trackingID, { debug: true });
it('should send a screenview request', function() {
const analytics = new Analytics(trackingID, { debug: true });
return analytics.event('category', 'view').then((response) => {
return expect(response).to.have.property('clientID');
}).catch((err) => {
return expect(err).to.be.empty;
return analytics.screen('test', '1.0.0', 'com.app.test', 'com.app.installer', 'Test')
.then((response) => {
return expect(response).to.have.property('clientID');
}).catch((err) => {
return expect(err).to.be.empty;
});
});
});
it('should fail sending a event request', function() {
it('should send a custom request', function() {
const analytics = new Analytics(trackingID, { debug: true });
return analytics.send('social', { sa: 'social', sn: 'facebook', st: 'home' })
.then((response) => {
return expect(response).to.have.property('clientID');
}).catch((err) => {
return expect(err).to.be.empty;
});
});
}
it('should fail sending a pageview request', function() {
const analytics = new Analytics('', { debug: true });
return analytics.event('category', 'view').then((response) => {
return analytics.pageview('http://example.com', 'test', 'test')
.then((response) => {
return expect(response).to.be.empty;

@@ -51,10 +67,9 @@ }).catch((err) => {

it('should send a screenview request', function() {
const analytics = new Analytics(trackingID, { debug: true });
it('should fail sending a event request', function() {
const analytics = new Analytics('', { debug: true });
return analytics.screen('test', '1.0.0', 'com.app.test', 'com.app.installer', 'Test')
.then((response) => {
return expect(response).to.have.property('clientID');
return analytics.event('category', 'view').then((response) => {
return expect(response).to.be.empty;
}).catch((err) => {
return expect(err).to.be.empty;
return expect(err).to.not.be.empty;
});

@@ -74,13 +89,2 @@ });

it('should send a custom request', function() {
const analytics = new Analytics(trackingID, { debug: true });
return analytics.send('social', { sa: 'social', sn: 'facebook', st: 'home' })
.then((response) => {
return expect(response).to.have.property('clientID');
}).catch((err) => {
return expect(err).to.be.empty;
});
});
it('should fail sending a custom request', function() {

@@ -87,0 +91,0 @@ const analytics = new Analytics('', { debug: true });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc