Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pusher/push-notifications-server

Package Overview
Dependencies
Maintainers
8
Versions
17
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 1.0.0 to 1.0.1

4

CHANGELOG.md

@@ -9,4 +9,8 @@ # Changelog

## [1.0.1] - 2018-10-15
### Fixed
- Accessing property on undefined object on non-json response
## [1.0.0] - 2018-07-31
### Added
- Changelog for GA release

2

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

@@ -5,0 +5,0 @@ "main": "push-notifications.js",

const https = require('https');
const SDK_VERSION = '1.0.0';
const SDK_VERSION = '1.0.1';
const INTERESTS_REGEX = new RegExp('^(_|\\-|=|@|,|\\.|;|[A-Z]|[a-z]|[0-9])*$');

@@ -127,3 +127,5 @@ const INTEREST_STRING_MAX_LENGTH = 164;

);
return;
}
if (wasSuccessful) {

@@ -130,0 +132,0 @@ resolve(responseBody);

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

authorization: 'Bearer SECRET_KEY',
'x-pusher-library': 'pusher-push-notifications-node 1.0.0',
'x-pusher-library': 'pusher-push-notifications-node 1.0.1',
host: 'instance_id.pushnotifications.pusher.com'

@@ -251,3 +251,3 @@ });

it('should reject the returned promise if response is not JSON', () => {
it('should reject the returned promise if response is not JSON (success)', () => {
nock(new RegExp('/.*/'))

@@ -264,5 +264,21 @@ .post(new RegExp('/.*/'))

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

@@ -269,0 +285,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