Created
June 17, 2015 14:19
-
-
Save ajcrites/bafb4bbca86a92788d0d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var assert = require("assert"); | |
var value = runner(callback); | |
assert.equal(value, "correct value"); | |
function runner(cb) { | |
if (true /* or some imaginary condition */) { | |
return cb("wrong value"); | |
} | |
return cb(null, "correct value"); | |
} | |
function callback(error, value) { | |
if (error) { | |
return error; | |
} | |
return value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment