New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

deride

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deride - npm Package Compare versions

Comparing version 0.1.11 to 0.1.12

44

lib/deride.js

@@ -39,19 +39,34 @@ /*

function checkArg(expected, values) {
var foundArg = false;
for (var valueIndex = 0; valueIndex < values.length; valueIndex++) {
var actual = values[valueIndex];
try {
assert.deepEqual(actual, expected);
foundArg = true;
break;
} catch (err) {}
}
return foundArg;
}
function checkArgs(expectedArgs, callArgs) {
var values = _.values(callArgs);
var argResults = [];
for (var argIndex = 0; argIndex < expectedArgs.length; argIndex++) {
var expected = expectedArgs[argIndex];
var foundArg = checkArg(expected, values);
argResults.push(foundArg);
}
return _.all(argResults);
}
function withArgs() {
var args = arguments;
var results = [];
var args = _.values(arguments);
var callResults = [];
_.forEach(calledWithArgs, function(value) {
var found = true;
for (var i = 0; i < arguments.length; i++) {
var actual = value[i];
var expected = args[i];
try{
assert.deepEqual(actual, expected);
found = true;
break;
}catch(err){ }
}
results.push(found);
var argResult = checkArgs(args, value);
callResults.push(argResult);
});
assert(_.any(results));
assert(_.any(callResults));
}

@@ -225,2 +240,3 @@

var wrapped = wrap(objHarness);
function createFunc() {

@@ -227,0 +243,0 @@ var returnVal = wrapped.value.apply(objHarness, arguments);

{
"name": "deride",
"description": "Mocking library based on composition",
"version": "0.1.11",
"version": "0.1.12",
"homepage": "https://github.com/REAANDREW/deride",

@@ -6,0 +6,0 @@ "author": {

@@ -62,2 +62,11 @@ /*

it('throws exception when object not called withArgs', function(done){
var obj = deride.stub(['send']);
obj.send(1,2,3);
assert.throws(function(){
obj.expect.send.called.withArgs(4);
}, Error);
done();
});
it('handles comparison of withArgs when an argument is a function', function(done) {

@@ -64,0 +73,0 @@ var obj = deride.stub(['send']);

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