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

percy

Package Overview
Dependencies
Maintainers
2
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

percy - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "percy",
"version": "1.0.2",
"version": "1.0.3",
"description": "A persistance layer that plays nice with Couchbase",

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

@@ -167,2 +167,3 @@ var kgo = require('kgo'),

}
percy.createId(function(error, id){

@@ -176,2 +177,4 @@ if(error){

});
return;
}

@@ -178,0 +181,0 @@

@@ -245,2 +245,40 @@ var test = require('grape'),

});
});
test('handels valid key from createKey', function(t){
t.plan(3);
var percy = createTestPercy(),
expectedResult = {
foo: 'bar',
id: 1
},
testkeys = 0;
percy.createId = function(callback){
callback(null, ++testkeys);
};
percy.add({foo: 'bar'}, function(error, result){
t.notOk(error, 'no error as expected');
t.ok(result, 'result passed as expected');
t.deepEqual(result, expectedResult, 'correct error passed');
});
});
test('createKey callsback only once with correct id', function(t){
t.plan(3);
var percy = createTestPercy(),
testId = 1234567890;
percy.createId = function(callback){
callback(null, testId);
};
percy.createKey(null, {foo: 'bar'}, function(error, result){
t.notOk(error, 'no error as expected');
t.ok(result, 'result passed as expected');
t.equal(result, 'thing:' + testId, 'result is correct id');
});
});
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