From 9fa197fd92da5a56f5bdaf7d8df8dab6e85af0d1 Mon Sep 17 00:00:00 2001 From: Raphael Pigulla Date: Thu, 20 Jul 2023 19:22:11 +0000 Subject: [PATCH] fix: Shutdown callback is not passed from provider to client (#118) --- lib/provider.js | 4 ++-- test/provider.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/provider.js b/lib/provider.js index b256fe50..60458d61 100644 --- a/lib/provider.js +++ b/lib/provider.js @@ -42,8 +42,8 @@ module.exports = function (dependencies) { ); }; - Provider.prototype.shutdown = function shutdown() { - this.client.shutdown(); + Provider.prototype.shutdown = function shutdown(callback) { + this.client.shutdown(callback); }; return Provider; diff --git a/test/provider.js b/test/provider.js index 212dc3c8..6674c589 100644 --- a/test/provider.js +++ b/test/provider.js @@ -174,10 +174,11 @@ describe('Provider', function () { describe('shutdown', function () { it('invokes shutdown on the client', function () { + const callback = sinon.spy(); const provider = new Provider({}); - provider.shutdown(); + provider.shutdown(callback); - expect(fakes.client.shutdown).to.be.calledOnce; + expect(fakes.client.shutdown).to.be.calledOnceWithExactly(callback); }); }); });