Skip to content

Commit af3c013

Browse files
committed
Slight cleanup to esline rules. Remove some overrides, refactor logic in _assertHeader function.
1 parent 1849094 commit af3c013

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

.eslintrc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,15 @@
88
// disabled - disagree with airbnb
99
"func-names": [0],
1010
"space-before-function-paren": [0],
11-
"padded-blocks": [0],
1211
"consistent-return": [0],
1312

1413
// Disabled but may want to refactor code eventually
1514
"no-proto": [1],
1615
"no-shadow": [1],
16+
"no-use-before-define": [2, "nofunc"],
1717

1818
// IMHO, more sensible overrides to existing airbnb error definitions
1919
"max-len": [2, 100, 4, {"ignoreComments": true, "ignoreUrls": true}],
20-
"comma-dangle": [2, "never"],
21-
"no-multi-spaces": [2, { "exceptions": { "VariableDeclarator": true, "Property": true } }],
22-
"no-unused-expressions": [2, { "allowShortCircuit": true, "allowTernary": true }],
23-
"no-use-before-define": [2, "nofunc"],
24-
"no-param-reassign": [2, {"props": false}],
25-
"no-cond-assign": [2, "except-parens"],
26-
"no-return-assign": [2, "except-parens"]
20+
"no-unused-expressions": [2, { "allowShortCircuit": true, "allowTernary": true }]
2721
}
2822
}

lib/test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ Test.prototype._assertHeader = function(header, res) {
217217
var fieldExpected = header.value;
218218

219219
if (typeof actual === 'undefined') return new Error('expected "' + field + '" header field');
220-
if (fieldExpected == actual) return; // eslint-disable-line eqeqeq
221-
/* if ((actual instanceof Array && actual.toString() === fieldExpected) ||
220+
// This check handles header values that may be a String or single element Array
221+
if ((actual instanceof Array && actual.toString() === fieldExpected) ||
222222
fieldExpected === actual) {
223223
return;
224-
} */
224+
}
225225
if (fieldExpected instanceof RegExp) {
226226
if (!fieldExpected.test(actual)) {
227227
return new Error('expected "' + field + '" matching ' +

test/.eslintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// errors - disabled for chai test support
44
"no-unused-expressions": [0],
55
// allow function args for superagent
6-
"no-unused-vars": [2, {"args": "none"}]
6+
"no-unused-vars": [2, {"args": "none"}],
7+
// allow updates to response for certain tests
8+
"no-param-reassign": [2, {"props": false}]
79
}
810
}

test/supertest.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,9 @@ describe('request(app)', function() {
612612
});
613613

614614
describe('handling arbitrary expect functions', function() {
615-
616615
var app;
617616
var get;
617+
618618
before(function() {
619619
app = express();
620620
app.get('/', function(req, res) {
@@ -703,7 +703,6 @@ describe('request(app)', function() {
703703
});
704704

705705
describe('handling multiple assertions per field', function() {
706-
707706
it('should work', function(done) {
708707
var app = express();
709708
app.get('/', function(req, res) {
@@ -1003,7 +1002,6 @@ describe('assert ordering by call order', function() {
10031002
});
10041003

10051004
describe('request.get(url).query(vals) works as expected', function() {
1006-
10071005
it('normal single query string value works', function(done) {
10081006
var app = express();
10091007
app.get('/', function(req, res) {

0 commit comments

Comments
 (0)