2 ms·
Help please: Learning developer's confusion on texting
imagine there is function which does something like this.
function someFunc(arguments, callback) {
// some kind of I/O operation.
someAsyncFunction([args. . . ], function(err, res) {
// do some processing on the data.
callback(null, attemptingNick);
});
}
How do you write tests for this?
If I try and write things inside callback in a separate functions then functions get really tiny.