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

sync-hooks

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-hooks - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

7

index.js
var GitHub = require('node-github')
, async = require('async')
, github = new GitHub({ version: "3.0.0" })

@@ -22,3 +23,3 @@ , _ = require('underscore')

if (hook && ! _(hook.events).deepEqual(config.events)) {
if (hook && ! _(hook.events).isEqual(config.events)) {
updateHook(hook, config, doneUpdatingHook)

@@ -28,3 +29,3 @@ } else if (!hook) {

} else {
done(null, hook)
doneUpdatingHook(null, hook)
}

@@ -67,3 +68,3 @@ })

github.getHooks({user: config.user, repo: config.repo}, function(err, hooks) {
github.repos.getHooks({user: config.user, repo: config.repo}, function(err, hooks) {
if (err) { cb(err) }

@@ -70,0 +71,0 @@ else { cb(err, hooks.filter(isOurHook).pop()) }

{
"name": "sync-hooks",
"version": "0.1.3",
"version": "0.1.4",
"description": "Function to install a batch of GitHub event hooks at once",

@@ -22,3 +22,4 @@ "main": "index.js",

"node-github": "0.0.3",
"underscore": "~1.5.2"
"underscore": "~1.5.2",
"async": "~0.2.10"
},

@@ -25,0 +26,0 @@ "repository": {

@@ -32,5 +32,5 @@ var assert = require('assert')

var config = {user: 'foo', repo: 'bar', url: 'http://foobar.com'}
, oldGetHooks = syncHooks.github.getHooks
, oldGetHooks = syncHooks.github.repos.getHooks
syncHooks.github.getHooks = function(config, callback) {
syncHooks.github.repos.getHooks = function(config, callback) {
callback(null, mockhooks)

@@ -41,6 +41,35 @@ }

assert.deepEqual(hook, mockhooks[1])
syncHooks.github.getHooks = oldGetHooks
syncHooks.github.repos.getHooks = oldGetHooks
done()
})
})
/*
it("should not find hooks on a repo that is inaccessible", function (done) {
var octopie = octoFactory();
octopie.add('fullscreeninc/bacon');
octopie._configureHooks(function (err, hooks) {
assert.deepEqual(hooks, [])
done();
});
});
it("should create our hook in response to not finding our hook", function (done) {
var octopie = octoFactory();
octopie.add('ryancbarry/underscore');
octopie.on('issues', function () {});
octopie.on('pull_request', function () {});
octopie._configureHooks(function (err, hooks) {
console.log('configured : hooks:\n', hooks);
// assert.deepEqual(hooks, [])
// var hook = hooks[0];
// assert(hook.config.url === 'http://google.com');
// assert(hook.name === 'web');
// assert.deepEqual(hook.events, ['issues', 'pull_request']);
// assert(hook.config.content_type === 'json');
// assert(hook.config.insecure_ssl === '1');
done();
});
});
*/
})
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