Skip to content

Commit 33bd49c

Browse files
committed
chore: bump deps
1 parent b3807ea commit 33bd49c

File tree

6 files changed

+6075
-3811
lines changed

6 files changed

+6075
-3811
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
language: node_js
22
node_js:
3-
- '6'
43
- '7'
54
- '8'
5+
- '10'
6+
- '12'
7+
- '14'
68
after_success:
79
npm run coverage

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
66
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
77
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
8-
[![license](https://img.shields.io/github/license/ladjs/koa-404-handler.svg)](<>)
8+
[![license](https://img.shields.io/github/license/ladjs/koa-404-handler.svg)]()
99

1010
> 404 handler for [Lad][] and [Koa][] (best used with [koa-better-error-handler][])
1111
@@ -64,7 +64,7 @@ app.listen();
6464
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)
6565

6666

67-
##
67+
##
6868

6969
[npm]: https://www.npmjs.com/
7070

package.json

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@
1313
],
1414
"dependencies": {},
1515
"devDependencies": {
16-
"ava": "^0.22.0",
16+
"ava": "^3.15.0",
1717
"babel-cli": "^6.26.0",
18-
"babel-preset-env": "^1.6.1",
19-
"boom": "^5.1.0",
20-
"codecov": "^2.3.0",
21-
"cross-env": "^5.0.5",
22-
"eslint": "^4.5.0",
23-
"eslint-config-prettier": "^2.3.0",
24-
"eslint-plugin-prettier": "^2.2.0",
25-
"husky": "^0.14.3",
26-
"koa": "^2.4.1",
27-
"koa-router": "^7.3.0",
28-
"lint-staged": "^4.0.4",
29-
"nyc": "^11.1.0",
30-
"prettier": "^1.6.1",
31-
"remark-cli": "^4.0.0",
32-
"remark-preset-github": "^0.0.6",
33-
"supertest": "^3.0.0",
34-
"xo": "^0.19.0"
18+
"babel-preset-env": "^1.7.0",
19+
"boom": "^7.3.0",
20+
"codecov": "^3.8.3",
21+
"cross-env": "^7.0.3",
22+
"eslint": "^8.3.0",
23+
"eslint-config-prettier": "^8.3.0",
24+
"eslint-plugin-prettier": "^4.0.0",
25+
"husky": "^7.0.4",
26+
"koa": "^2.13.4",
27+
"koa-router": "^10.1.1",
28+
"lint-staged": "^12.1.2",
29+
"nyc": "^15.1.0",
30+
"prettier": "^2.5.0",
31+
"remark-cli": "^10.0.1",
32+
"remark-preset-github": "^4.0.1",
33+
"supertest": "^6.1.6",
34+
"xo": "^0.47.0"
3535
},
3636
"engines": {
3737
"node": ">=6.4"
@@ -97,7 +97,8 @@
9797
],
9898
"capitalized-comments": "off",
9999
"camelcase": "off",
100-
"no-warning-comments": "off"
100+
"no-warning-comments": "off",
101+
"unicorn/prefer-module": "off"
101102
},
102103
"space": true
103104
}

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
// eslint-disable-next-line node/no-unsupported-features/es-syntax
12
const koa404Handler = async (ctx, next) => {
23
try {
34
await next();
45
if (ctx.status === 404) ctx.throw(404);
5-
} catch (err) {
6-
ctx.throw(err);
6+
} catch (error) {
7+
ctx.throw(error);
78
}
89
};
910

test/test.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ const Router = require('koa-router');
33
const Boom = require('boom');
44
const test = require('ava');
55
const request = require('supertest');
6-
const koa404Handler = require('../lib');
6+
const koa404Handler = require('../lib/index.js');
77

8-
const ok = ctx => {
8+
const ok = (ctx) => {
99
ctx.status = 200;
1010
ctx.body = { ok: 'ok' };
1111
};
@@ -14,11 +14,12 @@ const error = () => {
1414
throw new Error('Big Bad Error!');
1515
};
1616

17-
test('returns a function', t => {
17+
test('returns a function', (t) => {
1818
t.true(typeof koa404Handler === 'function');
1919
});
2020

21-
test.failing('middleware can be added to the app at any stage', async t => {
21+
// eslint-disable-next-line node/no-unsupported-features/es-syntax
22+
test.failing('middleware can be added to the app at any stage', async (t) => {
2223
const app = new Koa();
2324
const router = new Router();
2425

@@ -39,13 +40,15 @@ test.failing('middleware can be added to the app at any stage', async t => {
3940
// 404 handler
4041
app.use(koa404Handler);
4142

43+
// eslint-disable-next-line unicorn/prevent-abbreviations
4244
const res = await request(app.listen()).options('/');
4345

44-
t.is(200, res.status);
46+
t.is(res.status, 200);
4547
t.is(res.body.ok, 'ok');
4648
});
4749

48-
test('emits error on app instance', async t => {
50+
// eslint-disable-next-line node/no-unsupported-features/es-syntax
51+
test('emits error on app instance', async (t) => {
4952
const app = new Koa();
5053
const router = new Router();
5154

@@ -57,7 +60,7 @@ test('emits error on app instance', async t => {
5760
// 404 handler
5861
app.use(koa404Handler);
5962

60-
app.on('error', error => {
63+
app.on('error', (error) => {
6164
t.truthy(error);
6265
t.is(error.message, 'Big Bad Error!');
6366
});

0 commit comments

Comments
 (0)