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

bananas

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bananas - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

4

lib/index.js

@@ -15,3 +15,4 @@ 'use strict';

defaults: {
intervalMsec: 1000
intervalMsec: 1000,
root: false
}

@@ -26,2 +27,3 @@ };

const settings = Hoek.applyToDefaults(internals.defaults, options);
server = (settings.root ? server.root : server);

@@ -28,0 +30,0 @@ // Setup log queue and flush intervals

{
"name": "bananas",
"description": "Minimal Loggly hapi plugin",
"version": "1.2.1",
"version": "1.3.0",
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "repository": "git://github.com/hueniverse/bananas",

@@ -133,2 +133,55 @@ 'use strict';

});
it('logs valid event on late connection', { parallel: false }, (done) => {
const server = new Hapi.Server({ debug: false });
const settings = {
token: 'abcdefg',
intervalMsec: 50,
root: true
};
let updates = [];
const orig = Wreck.post;
Wreck.post = function (uri, options, next) {
updates = updates.concat(options.payload.split('\n'));
return next();
};
server.register({ register: Bananas, options: settings }, (err) => {
expect(err).to.not.exist();
server.connection();
server.route({
path: '/',
method: 'GET',
handler: function (request, reply) {
return reply('hello');
}
});
server.start((err) => {
expect(err).to.not.exist();
server.inject('/', (res) => {
setTimeout(() => {
expect(updates.length).to.equal(2);
Wreck.post = orig;
server.stop((err) => {
expect(err).to.not.exist();
done();
});
}, 200);
});
});
});
});
});
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