Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Test extends Request {
* Defer invoking superagent's `.end()` until
* the server is listening.
*
* @param {Function} fn
* @param {?Function} fn
* @api public
*/
end(fn) {
Expand All @@ -133,7 +133,7 @@ class Test extends Request {
*
* @param {?Error} resError
* @param {Response} res
* @param {Function} fn
* @param {?Function} fn
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please review your commit and fix these typos

* @api private
*/
assert(resError, res, fn) {
Expand Down Expand Up @@ -169,7 +169,9 @@ class Test extends Request {
errorObj = resError;
}

fn.call(this, errorObj || null, res);
if (fn) {
fn.call(this, errorObj || null, res);
}
}

/**
Expand Down