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

@pusher/push-notifications-server

Package Overview
Dependencies
Maintainers
8
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pusher/push-notifications-server - npm Package Compare versions

Comparing version 0.10.3 to 0.10.4

10

package.json
{
"name": "@pusher/push-notifications-server",
"version": "0.10.3",
"version": "0.10.4",
"description": "NodeJS Server SDK for Pusher Push Notifications",

@@ -21,3 +21,9 @@ "main": "push-notifications.js",

"test": "mocha tests.js"
}
},
"keywords": [
"push notifications",
"notifications",
"pusher",
"realtime"
]
}

9

push-notifications.js

@@ -108,3 +108,10 @@ const https = require('https');

response.on('end', function() {
const responseBody = JSON.parse(responseString);
let responseBody;
try {
responseBody = JSON.parse(responseString);
} catch (_) {
reject(
new Error('Unknown error - invalid server response')
);
}
if (wasSuccessful) {

@@ -111,0 +118,0 @@ resolve(responseBody);

@@ -10,3 +10,3 @@ [![Build Status](https://travis-ci.org/pusher/push-notifications-node.svg?branch=master)](https://travis-ci.org/pusher/push-notifications-node)

```bash
$ npm install pusher-push-notifications-node --save
$ npm install @pusher/push-notifications-server --save
```

@@ -16,3 +16,3 @@

```bash
$ yarn add pusher-push-notifications-node
$ yarn add @pusher/push-notifications-server
```

@@ -24,3 +24,3 @@

```javascript
const PushNotifications = require('pusher-push-notifications-node');
const PushNotifications = require('@pusher/push-notifications-server');

@@ -27,0 +27,0 @@ let pushNotifications = new PushNotifications({

@@ -196,3 +196,3 @@ const expect = require('chai').expect;

pn.publish(['donuts'], {}).catch(e => {
return pn.publish(['donuts'], {}).catch(e => {
expect(e).to.exist;

@@ -211,7 +211,28 @@ expect(e.message).to.contain('Not allow net connect');

pn.publish(['donuts'], {}).catch(e => {
expect(e).to.exist;
expect(e.message).to.contain('A fake error.');
});
return pn
.publish(['donuts'], {})
.then(() => {
throw new Error('This should not succeed');
})
.catch(e => {
expect(e).to.exist;
expect(e.message).to.contain('A fake error.');
});
});
it('should reject the returned promise if response is not JSON', () => {
nock(new RegExp('/.*/'))
.post(new RegExp('/.*/'))
.reply(200, 'thisisnotjson{{{{{');
return pn
.publish(['donuts'], {})
.then(() => {
throw new Error('This should not succeed');
})
.catch(e => {
expect(e).to.exist;
expect(e.message).to.contain('Unknown error');
});
});
});

@@ -218,0 +239,0 @@ });

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