Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade packages and adjust tests #671

Merged
merged 1 commit into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"consistent-return": [0],

// Disabled but may want to refactor code eventually
"no-shadow": [1],
"no-use-before-define": [2, "nofunc"],
"no-underscore-dangle": [0],

Expand Down
16 changes: 8 additions & 8 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Test.prototype.end = function(fn) {
*/

Test.prototype.assert = function(resError, res, fn) {
var error;
var errorObj;
var i;

// check for unexpected network errors or server not running/reachable errors
Expand All @@ -164,23 +164,23 @@ Test.prototype.assert = function(resError, res, fn) {
if (!res && resError) {
if (resError instanceof Error && resError.syscall === 'connect'
&& Object.getOwnPropertyNames(sysErrors).indexOf(resError.code) >= 0) {
error = new Error(resError.code + ': ' + sysErrors[resError.code]);
errorObj = new Error(resError.code + ': ' + sysErrors[resError.code]);
} else {
error = resError;
errorObj = resError;
}
}

// asserts
for (i = 0; i < this._asserts.length && !error; i += 1) {
error = this._assertFunction(this._asserts[i], res);
for (i = 0; i < this._asserts.length && !errorObj; i += 1) {
errorObj = this._assertFunction(this._asserts[i], res);
}

// set unexpected superagent error if no other error has occurred.
if (!error && resError instanceof Error && (!res || resError.status !== res.status)) {
error = resError;
if (!errorObj && resError instanceof Error && (!res || resError.status !== res.status)) {
errorObj = resError;
}

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

/**
Expand Down
Loading