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

hubot-npm

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubot-npm - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

test/hooks/package:deprecated.json

21

index.js

@@ -17,8 +17,29 @@ // Description:

return `${hook.change.user} starred ${hook.name} – ${url}`;
case 'package:unstar':
return `${hook.change.user} unstarred ${hook.name} – ${url}`;
case 'package:publish':
return `${hook.name}@${hook.change.version} published – ${url}`;
case 'package:unpublish':
return `${hook.name}@${hook.change.version} unpublished – ${url}`;
case 'package:owner':
return `${hook.name} owner added: ${hook.change.maintainer} – ${url}`;
case 'package:owner-rm':
return `${hook.name} owner removed: ${hook.change.maintainer} – ${url}`;
case 'package:dist-tag':
return `${hook.name} new dist-tag: ${hook.change['dist-tag']} – ${url}`;
case 'package:dist-tag-rm':
return `${hook.name} dist-tag removed: ${hook.change['dist-tag']} – ${url}`;
case 'package:deprecated':
return `${hook.name}@${hook.change.deprecated} deprecated – ${url}`;
case 'package:undeprecated':
return `${hook.name}@${hook.change.deprecated} undeprecated – ${url}`;
}

@@ -25,0 +46,0 @@ };

2

package.json
{
"name": "hubot-npm",
"version": "0.0.6",
"version": "0.0.7",
"description": "Hubot script for npm notifications",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -11,7 +11,13 @@ 'use strict';

const events = {
'package:publish': require('./events/package:publish'),
'package:unpublish': require('./events/package:unpublish'),
'package:star': require('./events/package:star'),
'package:unstar': require('./events/package:unstar')
const hooks = {
'package:publish': require('./hooks/package:publish'),
'package:unpublish': require('./hooks/package:unpublish'),
'package:star': require('./hooks/package:star'),
'package:unstar': require('./hooks/package:unstar'),
'package:owner': require('./hooks/package:owner'),
'package:owner-rm': require('./hooks/package:owner-rm'),
'package:dist-tag': require('./hooks/package:dist-tag'),
'package:dist-tag-rm': require('./hooks/package:dist-tag-rm'),
'package:deprecated': require('./hooks/package:deprecated'),
'package:undeprecated': require('./hooks/package:undeprecated')
};

@@ -42,3 +48,3 @@

.post('/hubot/npm?room=test-room')
.send(events['package:publish'])
.send(hooks['package:publish'])
.expect(200)

@@ -61,3 +67,3 @@ .end((err) => {

.post('/hubot/npm?room=test-room')
.send(events['package:unpublish'])
.send(hooks['package:unpublish'])
.expect(200)

@@ -80,3 +86,3 @@ .end((err) => {

.post('/hubot/npm?room=test-room')
.send(events['package:star'])
.send(hooks['package:star'])
.expect(200)

@@ -99,3 +105,3 @@ .end((err) => {

.post('/hubot/npm?room=test-room')
.send(events['package:unstar'])
.send(hooks['package:unstar'])
.expect(200)

@@ -115,8 +121,116 @@ .end((err) => {

it('supports the package:owner hook', (done) => {
request(robot.router)
.post('/hubot/npm?room=test-room')
.send(hooks['package:owner'])
.expect(200)
.end((err) => {
assert.ifError(err);
sinon.assert.calledWith(
robot.send,
sinon.match({
room: ['#test-room']
}),
'npm-hook-test owner added: a-user – https://www.npmjs.com/package/npm-hook-test'
);
done();
});
});
it('supports the package:owner-rm hook', (done) => {
request(robot.router)
.post('/hubot/npm?room=test-room')
.send(hooks['package:owner-rm'])
.expect(200)
.end((err) => {
assert.ifError(err);
sinon.assert.calledWith(
robot.send,
sinon.match({
room: ['#test-room']
}),
'npm-hook-test owner removed: a-user – https://www.npmjs.com/package/npm-hook-test'
);
done();
});
});
it('supports the package:dist-tag hook', (done) => {
request(robot.router)
.post('/hubot/npm?room=test-room')
.send(hooks['package:dist-tag'])
.expect(200)
.end((err) => {
assert.ifError(err);
sinon.assert.calledWith(
robot.send,
sinon.match({
room: ['#test-room']
}),
'npm-hook-test new dist-tag: beta – https://www.npmjs.com/package/npm-hook-test'
);
done();
});
});
it('supports the package:dist-tag-rm hook', (done) => {
request(robot.router)
.post('/hubot/npm?room=test-room')
.send(hooks['package:dist-tag-rm'])
.expect(200)
.end((err) => {
assert.ifError(err);
sinon.assert.calledWith(
robot.send,
sinon.match({
room: ['#test-room']
}),
'npm-hook-test dist-tag removed: beta – https://www.npmjs.com/package/npm-hook-test'
);
done();
});
});
it('supports the package:deprecated hook', (done) => {
request(robot.router)
.post('/hubot/npm?room=test-room')
.send(hooks['package:deprecated'])
.expect(200)
.end((err) => {
assert.ifError(err);
sinon.assert.calledWith(
robot.send,
sinon.match({
room: ['#test-room']
}),
'npm-hook-test@0.0.4 deprecated – https://www.npmjs.com/package/npm-hook-test'
);
done();
});
});
it('supports the package:undeprecated hook', (done) => {
request(robot.router)
.post('/hubot/npm?room=test-room')
.send(hooks['package:undeprecated'])
.expect(200)
.end((err) => {
assert.ifError(err);
sinon.assert.calledWith(
robot.send,
sinon.match({
room: ['#test-room']
}),
'npm-hook-test@0.0.4 undeprecated – https://www.npmjs.com/package/npm-hook-test'
);
done();
});
});
it('returns a 400 when the room is missing', (done) => {
request(robot.router)
.post('/hubot/npm')
.send(events.publish)
.send(hooks.publish)
.expect(400, 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