Created
June 1, 2011 05:32
-
-
Save jslatts/1001829 to your computer and use it in GitHub Desktop.
testing question
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
<snipped> | |
var watchFolderTree = function (fPath, fn) { | |
if (typeof fn !== 'function') { | |
throw { | |
name: 'TypeError', | |
message: 'fn must be a function' | |
}; | |
} | |
//Do lots of things to watch the folder tree | |
//How to test all this stuff? | |
return fn && fn(); | |
}; | |
exports.watch = function(reqPath, fn) { | |
var nPath = path.resolve(reqPath); | |
path.exists(nPath, function onExistsReturn(exists) { | |
if (!exists) { | |
nPath = nPath || ''; | |
return fn && fn('Path does not exist: ' + nPath); | |
} | |
watchFolderTree(nPath, fn); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment