Skip to content

Commit

Permalink
lint: apply standard 12 style
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Sep 11, 2018
1 parent 8ac8115 commit b604131
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 10 additions & 10 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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')
Expand All @@ -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')
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit b604131

Please sign in to comment.