Skip to content

Commit

Permalink
fix: Shutdown callback is not passed from provider to client (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
pigulla committed Jul 20, 2023
1 parent 87e7901 commit 9fa197f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions test/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});
Expand Down

0 comments on commit 9fa197f

Please sign in to comment.