any-db-fake
Advanced tools
Comparing version 0.0.3 to 2.3.0
var EventEmitter = require('events').EventEmitter | ||
var extend = require('extend') | ||
var extend = require('extend') | ||
module.exports = extend(createMockAdapter, { | ||
connection: { | ||
query: function (text, params, callback) { | ||
query: function(text, params, callback) { | ||
var q = this.adapter.createQuery(text, params, callback) | ||
process.nextTick(function () { | ||
process.nextTick(function() { | ||
if (q.callback) q.callback() | ||
@@ -14,6 +14,6 @@ q.emit('end') | ||
}, | ||
end: function () {} | ||
end: function() {}, | ||
}, | ||
createQuery: function (text, params, callback) { | ||
createQuery: function(text, params, callback) { | ||
if (typeof text == 'object') { | ||
@@ -27,12 +27,12 @@ return text | ||
return extend(new EventEmitter, this.query, { | ||
return extend(new EventEmitter(), this.query, { | ||
text: text, | ||
params: params, | ||
callback: callback | ||
callback: callback, | ||
}) | ||
}, | ||
createConnection: function (_, cb) { | ||
var connection = extend(new EventEmitter, this.connection, { | ||
adapter: this | ||
createConnection: function(_, cb) { | ||
var connection = extend(new EventEmitter(), this.connection, { | ||
adapter: this, | ||
}) | ||
@@ -43,8 +43,7 @@ if (cb) { | ||
return connection | ||
} | ||
}, | ||
}) | ||
function createMockAdapter (overrides) { | ||
function createMockAdapter(overrides) { | ||
return extend(true, {}, createMockAdapter, overrides) | ||
} | ||
{ | ||
"name": "any-db-fake", | ||
"version": "0.0.3", | ||
"version": "2.3.0", | ||
"description": "Fake adapter factory for testing any-db related libraries", | ||
@@ -5,0 +5,0 @@ "main": "mock-adapter.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
1599