From 675d43d966504fe85f655e3ae9c2c4c63fb14a8e Mon Sep 17 00:00:00 2001 From: David Luecke Date: Fri, 20 Oct 2017 10:44:40 -0700 Subject: [PATCH] Also pass app object as parameter to configure callbacks --- lib/application.js | 2 +- test/application.test.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index bef7c06625..57acb1b95c 100644 --- a/lib/application.js +++ b/lib/application.js @@ -56,7 +56,7 @@ const application = { }, configure (fn) { - fn.call(this); + fn.call(this, this); return this; }, diff --git a/test/application.test.js b/test/application.test.js index a7deee1392..15c8c8891e 100644 --- a/test/application.test.js +++ b/test/application.test.js @@ -65,6 +65,13 @@ describe('Feathers application', () => { }); }); + it('additionally passes `app` as .configure parameter (#558)', done => { + feathers().configure(function (app) { + assert.equal(this, app); + done(); + }); + }); + describe('Services', () => { it('calling .use with a non service object throws', () => { const app = feathers();