@@ -3,9 +3,9 @@ const Router = require('koa-router');
33const Boom = require ( 'boom' ) ;
44const test = require ( 'ava' ) ;
55const 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