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

@octokit/webhooks

Package Overview
Dependencies
Maintainers
3
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/webhooks - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

2

event-handler/receive.js

@@ -48,3 +48,3 @@ 'use strict'

.catch(error => errors.push(Object.assign(error, {event})))
.catch(error => errors.push(Object.assign(error, {event})))
})

@@ -51,0 +51,0 @@

@@ -60,11 +60,11 @@ module.exports = middleware

.then(() => {
response.end('ok\n')
})
.then(() => {
response.end('ok\n')
})
.catch(error => {
response.statusCode = error.status || 500
response.end(error.toString())
})
.catch(error => {
response.statusCode = error.status || 500
response.end(error.toString())
})
})
}
{
"name": "@octokit/webhooks",
"version": "3.1.0",
"version": "3.1.1",
"publishConfig": {

@@ -14,14 +14,14 @@ "access": "public"

"dependencies": {
"buffer-equal-constant-time": "^1.0.1"
"buffer-equal-constant-time": "^1.0.1",
"debug": "^3.1.0"
},
"devDependencies": {
"axios": "^0.17.1",
"axios": "^0.18.0",
"coveralls": "^3.0.0",
"debug": "^3.1.0",
"get-port": "^3.2.0",
"pify": "^3.0.0",
"proxyquire": "^1.8.0",
"semantic-release": "^11.0.2",
"proxyquire": "^2.0.0",
"semantic-release": "^15.0.0",
"simple-mock": "^0.8.0",
"standard": "^10.0.3",
"standard": "^11.0.0",
"tap": "^11.0.0"

@@ -28,0 +28,0 @@ },

@@ -16,5 +16,5 @@ const test = require('tap').test

.then(() => {
hooksCalled.push('hook1')
})
.then(() => {
hooksCalled.push('hook1')
})
}

@@ -58,35 +58,35 @@ function hook2 () {

.then(() => {
return eventHandler.receive({
id: '456',
name: 'installation',
payload: installationCreatedPayload
.then(() => {
return eventHandler.receive({
id: '456',
name: 'installation',
payload: installationCreatedPayload
})
})
})
.then(() => {
t.deepEqual(hooksCalled, ['hook2', '* (push)', 'hook1', 'installation.created', 'installation', '* (installation)'])
.then(() => {
t.deepEqual(hooksCalled, ['hook2', '* (push)', 'hook1', 'installation.created', 'installation', '* (installation)'])
eventHandler.on('error', (error) => {
t.pass('error event triggered')
t.is(error.message, 'oops')
})
eventHandler.on('error', (error) => {
t.pass('error event triggered')
t.is(error.message, 'oops')
})
eventHandler.on('push', () => {
throw new Error('oops')
eventHandler.on('push', () => {
throw new Error('oops')
})
return eventHandler.receive({
id: '123',
name: 'push',
payload: pushEventPayload
})
})
return eventHandler.receive({
id: '123',
name: 'push',
payload: pushEventPayload
.catch(error => {
t.is(error.errors.length, 1)
t.is(error.errors[0].message, 'oops')
})
})
.catch(error => {
t.is(error.errors.length, 1)
t.is(error.errors[0].message, 'oops')
})
.catch(t.error)
.catch(t.error)
})

@@ -93,0 +93,0 @@

@@ -18,5 +18,5 @@ const http = require('http')

.then((port) => {
this.port = port
})
.then((port) => {
this.port = port
})
})

@@ -40,19 +40,19 @@

.then(() => {
return axios.get(`http://localhost:${this.port}`)
})
.then(() => {
return axios.get(`http://localhost:${this.port}`)
})
.then(() => {
t.fail('should return a 404')
})
.then(() => {
t.fail('should return a 404')
})
.catch(error => {
t.is(error.response.status, 404)
})
.catch(error => {
t.is(error.response.status, 404)
})
.then(() => {
server.close(t.end)
})
.then(() => {
server.close(t.end)
})
.catch(t.error)
.catch(t.error)
})

@@ -72,23 +72,23 @@

.then(() => {
return axios.post(`http://localhost:${this.port}`, pushEventPayload, {
headers: {
'X-GitHub-Delivery': '123e4567-e89b-12d3-a456-426655440000',
'X-GitHub-Event': 'push',
'X-Hub-Signature': 'sha1=f4d795e69b5d03c139cc6ea991ad3e5762d13e2f'
}
.then(() => {
return axios.post(`http://localhost:${this.port}`, pushEventPayload, {
headers: {
'X-GitHub-Delivery': '123e4567-e89b-12d3-a456-426655440000',
'X-GitHub-Event': 'push',
'X-Hub-Signature': 'sha1=f4d795e69b5d03c139cc6ea991ad3e5762d13e2f'
}
})
})
})
.catch(t.error)
.catch(t.error)
.then(result => {
t.is(result.status, 200)
})
.then(result => {
t.is(result.status, 200)
})
.then(() => {
server.close()
})
.then(() => {
server.close()
})
.catch(t.error)
.catch(t.error)
})

@@ -102,24 +102,24 @@

.then(() => {
return axios.post(`http://localhost:${this.port}`, pushEventPayload, {
headers: {
'X-GitHub-Delivery': '123e4567-e89b-12d3-a456-426655440000',
'X-GitHub-Event': 'push'
}
.then(() => {
return axios.post(`http://localhost:${this.port}`, pushEventPayload, {
headers: {
'X-GitHub-Delivery': '123e4567-e89b-12d3-a456-426655440000',
'X-GitHub-Event': 'push'
}
})
})
})
.then(() => {
t.fail('should return a 400')
})
.then(() => {
t.fail('should return a 400')
})
.catch(error => {
t.is(error.response.status, 400)
})
.catch(error => {
t.is(error.response.status, 400)
})
.then(() => {
server.close(t.end)
})
.then(() => {
server.close(t.end)
})
.catch(t.error)
.catch(t.error)
})

@@ -135,26 +135,26 @@

.then(() => {
return axios.post(`http://localhost:${this.port}`, pushEventPayload, {
headers: {
'X-GitHub-Delivery': '123e4567-e89b-12d3-a456-426655440000',
'X-GitHub-Event': 'push',
'X-Hub-Signature': 'sha1=foo'
}
.then(() => {
return axios.post(`http://localhost:${this.port}`, pushEventPayload, {
headers: {
'X-GitHub-Delivery': '123e4567-e89b-12d3-a456-426655440000',
'X-GitHub-Event': 'push',
'X-Hub-Signature': 'sha1=foo'
}
})
})
})
.then(() => {
t.fail('should return a 400')
})
.then(() => {
t.fail('should return a 400')
})
.catch(error => {
t.is(error.response.status, 400)
})
.catch(error => {
t.is(error.response.status, 400)
})
.then(() => {
t.is(errorHandler.callCount, 1, 'calls "error" event handler')
server.close(t.end)
})
.then(() => {
t.is(errorHandler.callCount, 1, 'calls "error" event handler')
server.close(t.end)
})
.catch(t.error)
.catch(t.error)
})

@@ -172,25 +172,25 @@

.then(() => {
return axios.post(`http://localhost:${this.port}`, pushEventPayload, {
headers: {
'X-GitHub-Delivery': '123e4567-e89b-12d3-a456-426655440000',
'X-GitHub-Event': 'push',
'X-Hub-Signature': 'sha1=f4d795e69b5d03c139cc6ea991ad3e5762d13e2f'
}
.then(() => {
return axios.post(`http://localhost:${this.port}`, pushEventPayload, {
headers: {
'X-GitHub-Delivery': '123e4567-e89b-12d3-a456-426655440000',
'X-GitHub-Event': 'push',
'X-Hub-Signature': 'sha1=f4d795e69b5d03c139cc6ea991ad3e5762d13e2f'
}
})
})
})
.then(() => {
t.fail('should return a 500')
})
.then(() => {
t.fail('should return a 500')
})
.catch(error => {
t.is(error.response.status, 500)
})
.catch(error => {
t.is(error.response.status, 500)
})
.then(() => {
server.close(t.end)
})
.then(() => {
server.close(t.end)
})
.catch(t.error)
.catch(t.error)
})

Sorry, the diff of this file is not supported yet

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