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

larvitdbmigration

Package Overview
Dependencies
Maintainers
2
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

larvitdbmigration - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

testmigrations_mariadb_failing/1.js

11

dbType/elasticsearch.js
'use strict';
const topLogPrefix = 'larvitdbmigration: dbType/elasticsearch.js - ',
const topLogPrefix = 'larvitdbmigration: dbType/elasticsearch.js: ',
request = require('request'),

@@ -284,4 +284,5 @@ async = require('async'),

cb(scriptErr);
return cb(scriptErr);
});
return;
}

@@ -306,3 +307,3 @@

} else {
cb();
return cb();
}

@@ -313,6 +314,6 @@ });

log.error(logPrefix + 'Uncaught error: ' + err.message);
cb(err);
return cb(err);
}
} else {
cb();
return cb();
}

@@ -319,0 +320,0 @@ });

'use strict';
const topLogPrefix = 'larvitdbmigration: dbType/larvitdb.js - ',
const topLogPrefix = 'larvitdbmigration: dbType/larvitdb.js: ',
async = require('async'),

@@ -5,0 +5,0 @@ mysql = require('mysql2'),

@@ -11,3 +11,4 @@ {

"async": "^2.0.1",
"elasticsearch": "^12.1.3",
"elasticsearch": "^13.0.0",
"json-stringify-safe": "^5.0.1",
"larvitdb": "^1.2.2",

@@ -39,3 +40,3 @@ "larvitutils": "^1.1.1",

},
"version": "2.0.3",
"version": "2.0.4",
"readmeFilename": "README.md",

@@ -42,0 +43,0 @@ "scripts": {

@@ -20,8 +20,2 @@ 'use strict';

log.remove(log.transports.Console);
log.add(log.transports.Console, {
'level': 'warn',
'colorize': true,
'timestamp': true,
'json': false
});

@@ -221,2 +215,30 @@ before(function (done) {

});
it('Should fail when migration returns error', function (done) {
const tasks = [];
// Clean out database
tasks.push(function (cb) {
db.removeAllTables(cb);
});
// Run failing migrations
tasks.push(function (cb) {
let dbMigrations;
mariaDbConf.migrationScriptsPath = path.join(__dirname, '../testmigrations_mariadb_failing');
mariaDbConf.dbType = 'larvitdb';
mariaDbConf.dbDriver = db;
dbMigrations = new DbMigration(mariaDbConf);
dbMigrations.run(function (err) {
assert(err instanceof Error, 'err should be an instance of Error');
cb();
});
});
async.series(tasks, done);
});
});

@@ -223,0 +245,0 @@

Sorry, the diff of this file is not supported yet

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