diff --git a/test/application/use.js b/test/application/use.js index dcdefd7..a8fbfdf 100644 --- a/test/application/use.js +++ b/test/application/use.js @@ -52,4 +52,11 @@ describe('app.use(fn)', function(){ .expect(404) .end(done); }); + + it('should throw error for non function', function(done){ + const app = new Koa(); + + (() => app.use('not a function')).should.throw('middleware must be a function!'); + done(); + }); });