diff --git a/.travis.yml b/.travis.yml index b21c9e2..fd0dcb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_install: - "npm config set shrinkwrap false" # Setup Node.js version-specific dependencies - "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul" - - "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev $(grep -E '\"eslint\\S*\"' package.json | cut -d'\"' -f2)" + - "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 6 || npm rm --save-dev $(grep -E '\"eslint\\S*\"' package.json | cut -d'\"' -f2)" # Update Node.js modules - "test ! -d node_modules || npm prune" - "test ! -d node_modules || npm rebuild" diff --git a/README.md b/README.md index 1a1791b..d2ca173 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ var app = connect() if (process.env.NODE_ENV === 'development') { // only use in development - app.use(errorhandler({log: errorNotification})) + app.use(errorhandler({ log: errorNotification })) } function errorNotification (err, str, req) { diff --git a/package.json b/package.json index 8c5ba06..2881d2b 100644 --- a/package.json +++ b/package.json @@ -14,13 +14,13 @@ }, "devDependencies": { "after": "0.8.2", - "eslint": "4.19.1", - "eslint-config-standard": "11.0.0", - "eslint-plugin-import": "2.13.0", + "eslint": "5.5.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", "eslint-plugin-markdown": "1.0.0-beta.6", - "eslint-plugin-node": "6.0.1", - "eslint-plugin-promise": "3.8.0", - "eslint-plugin-standard": "3.1.0", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", "istanbul": "0.4.5", "mocha": "2.5.3", "supertest": "1.1.0" diff --git a/test/test.js b/test/test.js index 020a022..e19e539 100644 --- a/test/test.js +++ b/test/test.js @@ -20,7 +20,7 @@ describe('errorHandler()', function () { describe('status code', function () { describe('when non-error status code', function () { it('should set the status code to 500', function (done) { - var server = createServer({status: 200}) + var server = createServer({ status: 200 }) request(server) .get('/') .expect(500, done) @@ -29,7 +29,7 @@ describe('errorHandler()', function () { describe('when err.status exists', function () { it('should set res.statusCode', function (done) { - var server = createServer({status: 404}) + var server = createServer({ status: 404 }) request(server) .get('/') .expect(404, done) @@ -38,7 +38,7 @@ describe('errorHandler()', function () { describe('when err.statusCode exists', function () { it('should set res.statusCode', function (done) { - var server = createServer({statusCode: 404}) + var server = createServer({ statusCode: 404 }) request(server) .get('/') .expect(404, done) @@ -47,7 +47,7 @@ describe('errorHandler()', function () { describe('when err.statusCode and err.status exist', function () { it('should prefer err.status', function (done) { - var server = createServer({statusCode: 400, status: 404}) + var server = createServer({ statusCode: 400, status: 404 }) request(server) .get('/') .expect(404, done) @@ -89,7 +89,7 @@ describe('errorHandler()', function () { describe('when object', function () { it('should use util.inspect', function (done) { - var server = createServer({hop: 'pop'}) + var server = createServer({ hop: 'pop' }) request(server) .get('/') .set('Accept', 'text/plain') @@ -99,7 +99,7 @@ describe('errorHandler()', function () { describe('with "toString" property', function () { it('should use "toString" value', function (done) { - var server = createServer({toString: function () { return 'boom!' }}) + var server = createServer({ toString: function () { return 'boom!' } }) request(server) .get('/') .set('Accept', 'text/plain') @@ -243,7 +243,7 @@ describe('errorHandler()', function () { describe('errorHandler(options)', function () { describe('log', function () { it('should reject a string', function () { - assert.throws(errorHandler.bind(null, {log: 'yes, please'}), /option log must be/) + assert.throws(errorHandler.bind(null, { log: 'yes, please' }), /option log must be/) }) describe('when "undefined"', function () { @@ -319,7 +319,7 @@ describe('errorHandler(options)', function () { it('should write to console', function (done) { var cb = after(2, done) var error = new Error('boom!') - var server = createServer(error, {log: true}) + var server = createServer(error, { log: true }) console.error = function () { var log = util.format.apply(null, arguments) @@ -351,7 +351,7 @@ describe('errorHandler(options)', function () { it('should not write to console', function (done) { var error = new Error('boom!') - var server = createServer(error, {log: false}) + var server = createServer(error, { log: false }) console.error = function () { var log = util.format.apply(null, arguments) @@ -374,7 +374,7 @@ describe('errorHandler(options)', function () { it('should call function', function (done) { var cb = after(2, done) var error = new Error('boom!') - var server = createServer(error, {log: log}) + var server = createServer(error, { log: log }) function log (err, str, req, res) { assert.strictEqual(err, error)