From 6aa1783a87021e919b6b0e533169a9306067f52d Mon Sep 17 00:00:00 2001 From: Jason Walton Date: Mon, 17 Oct 2022 10:00:25 -0400 Subject: [PATCH] test: Add test case to ensure we don't throw when removing a 'setup' that is not on the channel. re: #92 --- test/ChannelWrapperTest.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/ChannelWrapperTest.ts b/test/ChannelWrapperTest.ts index d5881a3..67ac3a7 100644 --- a/test/ChannelWrapperTest.ts +++ b/test/ChannelWrapperTest.ts @@ -480,6 +480,11 @@ describe('ChannelWrapper', function () { expect(setup).to.have.not.beenCalled; }); + it('should fail silently when removing a setup that was not added', async () => { + const channelWrapper = new ChannelWrapper(connectionManager); + await channelWrapper.removeSetup(() => undefined); + }); + it('should run teardown when removing a setup if we are connected', async function () { const setup = jest.fn().mockImplementation(() => Promise.resolve()); const teardown = jest.fn().mockImplementation(() => Promise.resolve());