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.6 to 0.1.7

lib/utils/index.js

32

lib/deride.js

@@ -31,23 +31,5 @@ /*

var assert = require('assert');
var utils = require('./utils');
var events = require('events');
var methods = function(obj) {
var funcs = [];
var methods = Object.getOwnPropertyNames(obj);
if (obj.constructor !== Object) {
_.forEach(obj.constructor.prototype, function(value, property) {
methods.push(property);
});
}
_.forEach(methods, function(value) {
var member = typeof(obj[value]);
if (member === 'function') {
funcs.push(value);
}
});
return funcs;
};
var Expectations = function() {

@@ -64,3 +46,3 @@

for (var i = 0; i < arguments.length; i++) {
if (value[i] !== args[i]) {
if (JSON.stringify(value[i]) !== JSON.stringify(args[i])) {
found = false;

@@ -149,3 +131,3 @@ break;

var originalTimeoutFunc = setTimeout;
setTimeout = function(delegate, timeout){
setTimeout = function(delegate, timeout) {
originalTimeoutFunc(delegate, timeout - milliseconds);

@@ -199,3 +181,3 @@ };

toCallbackWith: toCallbackWith,
toTimeWarp : toTimeWarp,
toTimeWarp: toTimeWarp,
when: when,

@@ -212,6 +194,8 @@ call: call

function wrap(obj) {
var objMethods = methods(obj);
var objMethods = utils.methods(obj);
var self = {};
var expectMethods = {};
var setupMethods = {};
var eventEmitter = new events.EventEmitter();
utils.proxyFunctions(self, eventEmitter, ['on', 'emit']);

@@ -218,0 +202,0 @@ function setupForMethod(method) {

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

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

@@ -49,2 +49,14 @@ /*

describe('Eventing', function() {
it('should allow the force of an emit', function(done) {
var bob = deride.stub([]);
bob = deride.wrap(bob);
bob.on('message', function() {
done();
});
bob.emit('message', 'payload');
});
});
var fooBarFunction = function(timeout, callback) {

@@ -51,0 +63,0 @@ setTimeout(function() {

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