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

factory-girl

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

factory-girl - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

22

index.js

@@ -8,3 +8,4 @@ (function() {

defaultAdapter = null,
adapters = {};
adapters = {},
created = [];

@@ -22,3 +23,3 @@ var factory = function(name, userAttrs, callback) {

factory.adapterFor(name).save(doc, model, function(err) {
if (!err) factories[name].created.push(doc);
if (!err) created.push([name, doc]);
callback(err, doc);

@@ -34,4 +35,3 @@ });

model: model,
attributes: attributes,
created: []
attributes: attributes
};

@@ -115,10 +115,10 @@ };

factory.cleanup = function(callback) {
asyncForEach(keys(factories), function(name, cb1) {
var model = factories[name].model,
adapter = factory.adapterFor(name);
asyncForEach(factories[name].created, function(doc, cb2) {
adapter.destroy(doc, model, cb2);
}, cb1);
factories[name].created = [];
asyncForEach(created.reverse(), function(tuple, cb) {
var name = tuple[0],
doc = tuple[1],
adapter = factory.adapterFor(name),
model = factories[name].model;
adapter.destroy(doc, model, cb);
}, callback);
created = [];
};

@@ -125,0 +125,0 @@

@@ -6,3 +6,3 @@ {

"author": "Simon Wade",
"version": "0.1.3",
"version": "0.1.4",
"keywords": ["factory", "test", "bdd", "tdd", "fixture"],

@@ -9,0 +9,0 @@ "repository" : {

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