Last active
December 28, 2015 15:38
-
-
Save kilianc/7522780 to your computer and use it in GitHub Desktop.
Testing if I forgot to make each method continuable. I am afraid I may be going insane.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('#*', function () { | |
it('should return a continuable if a callback is not passed', function () { | |
Object.keys(Db.prototype).forEach(function (functionName) { | |
var params = introspect(db[functionName]) | |
if (params.pop() === 'callback') { | |
var fnStr = db[functionName].toString() | |
var line = f('if (undefined === callback) return this.%s.bind(this, %s)', functionName, params.join(', ')) | |
assert.isFunction(db[functionName](), functionName) | |
assert.ok(~fnStr.indexOf(line), functionName) | |
} | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment