From c6d4136237ac9b2771b130c47c93d5111d853045 Mon Sep 17 00:00:00 2001 From: souvik Date: Thu, 21 Sep 2023 17:15:06 +0530 Subject: [PATCH] fix the tests --- src/lib/adapter.ts | 4 ++-- test/lib/adapter.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/adapter.ts b/src/lib/adapter.ts index 954ecf326..3d85f333c 100644 --- a/src/lib/adapter.ts +++ b/src/lib/adapter.ts @@ -230,11 +230,11 @@ class GleeAdapter extends EventEmitter { getSubscribedChannels(): string[] { return this._channelNames.filter((channelName) => { const channel = this._parsedAsyncAPI.channels().get(channelName) - if (channel.operations().filterByReceive().length <= 0) return false + if (channel.operations().filterBySend().length == 0) return true const channelServers = channel.servers() ? channel.servers() - : channel.extensions().get('x-servers').value() || this._parsedAsyncAPI.channels().map(e => e.address) + : channel.extensions().get('x-servers')?.value() || this._parsedAsyncAPI.allServers() return channelServers.includes(this._serverName) }) } diff --git a/test/lib/adapter.test.ts b/test/lib/adapter.test.ts index ef6c612e5..8942ea4f6 100644 --- a/test/lib/adapter.test.ts +++ b/test/lib/adapter.test.ts @@ -151,7 +151,7 @@ describe('adapter', () => { TEST_ASYNCAPI_DOCUMENT ) expect(adapter.channelNames).toStrictEqual( - TEST_ASYNCAPI_DOCUMENT.channels().all().map(e =>e.address) + TEST_ASYNCAPI_DOCUMENT.channels().all().map(e =>e.address()) ) }) })