Help please: Learning developer's confusion on texting

https://news.ycombinator.com/item?id=10115533
by curiouskevin • 11 years ago
1 0 11 years ago

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.

Related Stories

Loading related stories...

Source preview

news.ycombinator.com