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

penseur

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

penseur - npm Package Compare versions

Comparing version 5.2.3 to 5.3.0

17

lib/db.js

@@ -531,10 +531,19 @@ 'use strict';

this.tables[table][method] = internals.disabled;
this.tables[table][method] = internals.disabled(options);
};
internals.disabled = function () {
internals.disabled = function (options) {
const callback = arguments[arguments.length - 1];
return callback(Boom.internal('Simulated database error'));
const value = options.value;
return function () {
const callback = arguments[arguments.length - 1];
if (value !== undefined) {
return callback(null, value);
}
return callback(Boom.internal('Simulated database error'));
};
};

@@ -541,0 +550,0 @@

{
"name": "penseur",
"description": "Lightweight RethinkDB wrapper",
"version": "5.2.3",
"version": "5.3.0",
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)",

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

@@ -889,2 +889,44 @@ 'use strict';

it('simulates a response', (done) => {
const db = new Penseur.Db('penseurtest', { host: 'localhost', port: 28015, test: true });
db.establish(['test'], (err) => {
expect(err).to.not.exist();
db.test.insert({ id: 1, value: 'x' }, (err, result) => {
expect(err).to.not.exist();
db.test.get(1, (err, item1) => {
expect(err).to.not.exist();
expect(item1.value).to.equal('x');
db.disable('test', 'get', { value: 'hello' });
db.test.get(1, (err, item2) => {
expect(err).to.not.exist();
expect(item2).to.equal('hello');
db.disable('test', 'get', { value: null });
db.test.get(1, (err, item3) => {
expect(err).to.not.exist();
expect(item3).to.be.null();
db.enable('test', 'get');
db.test.get(1, (err, item4) => {
expect(err).to.not.exist();
expect(item4.value).to.equal('x');
db.close(done);
});
});
});
});
});
});
});
it('simulates a changes error', (done) => {

@@ -891,0 +933,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