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

sequelize-fixtures

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sequelize-fixtures - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

.travis.yml

31

index.js

@@ -16,3 +16,3 @@ var Loader = require('./lib/loader'),

} else {
var fixtures = arguments[0], models = arguments[1], options, cb, i;
var fixtures = arguments[0], models = arguments[1], options, i, cb, promise;
for(i = 2; i < arguments.length; i++) {

@@ -22,3 +22,14 @@ if (typeof arguments[i] === 'object') options = arguments[i];

}
return fn(fixtures, models, initopts(options), cb);
promise = fn(fixtures, models, initopts(options));
if (cb) {
console.warn("Sequelize-fixtures: callback arguments are deprecated, please use returned promises.");
promise.then(function () {
cb();
}, function (err) {
cb(err);
}).catch(function (err){
cb(err);
});
}
return promise;
}

@@ -28,24 +39,24 @@ };

exports.loadFixture = wrap(function(fixture, models, options, cb) {
exports.loadFixture = wrap(function(fixture, models, options) {
var loader = new Loader(options);
return loader.loadFixture(fixture, models, cb);
return loader.loadFixture(fixture, models);
});
exports.loadFixtures = wrap(function(fixtures, models, options, cb) {
exports.loadFixtures = wrap(function(fixtures, models, options) {
var loader = new Loader(options);
return loader.loadFixtures(fixtures, models, cb);
return loader.loadFixtures(fixtures, models);
});
exports.loadFile = wrap(function(filename, models, options, cb) {
exports.loadFile = wrap(function(filename, models, options) {
var loader = new Loader(options), reader = new Reader(options);
return reader.readFileGlob(filename).then(function(fixtures) {
return loader.loadFixtures(fixtures, models, cb);
return loader.loadFixtures(fixtures, models);
});
});
exports.loadFiles = wrap(function(filenames, models, options, cb) {
exports.loadFiles = wrap(function(filenames, models, options) {
var loader = new Loader(options), reader = new Reader(options);
return reader.readFiles(filenames).then(function(fixtures){
return loader.loadFixtures(fixtures, models, cb);
return loader.loadFixtures(fixtures, models);
});
});

@@ -9,11 +9,9 @@ var Promise = require('bluebird');

Loader.prototype.loadFixtures = function(fixtures, models, cb) {
Loader.prototype.loadFixtures = function(fixtures, models) {
return Promise.each(fixtures, function(fixture) {
return this.loadFixture(fixture, models);
}.bind(this)).then(function() {
if (cb) cb();
});
}.bind(this));
};
Loader.prototype.loadFixture = function(fixture, models, cb) {
Loader.prototype.loadFixture = function(fixture, models) {
var buildOptions = fixture.buildOptions,

@@ -78,4 +76,2 @@ saveOptions = fixture.saveOptions,

});
}).then(function() {
if (cb) cb();
}).catch(onError);

@@ -82,0 +78,0 @@ });

{
"name": "sequelize-fixtures",
"version": "0.4.2",
"version": "0.4.3",
"description": "sequelize fixture loader",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/mocha tests"
"test": "rm -f ./testdb.sqlite && ./node_modules/.bin/mocha tests"
},

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

@@ -0,1 +1,3 @@

[![Build Status](https://travis-ci.org/domasx2/sequelize-fixtures.svg?branch=master)](https://travis-ci.org/domasx2/sequelize-fixtures)
Sequelize fixtures

@@ -2,0 +4,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