From e859c602d152e002d637cd7cf8dd37293990b80a Mon Sep 17 00:00:00 2001 From: broucz Date: Sun, 25 Oct 2015 08:54:57 +0100 Subject: [PATCH] Update test: application -> use() should throw if not a function closes #550 Fix lint Use arrow function Remove not necessary import --- test/application/use.js | 7 +++++++ 1 file changed, 7 insertions(+) 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(); + }); });