Skip to content

Commit

Permalink
fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvikns committed Sep 21, 2023
1 parent 5c90e5b commit c6d4136
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
Expand Down
2 changes: 1 addition & 1 deletion test/lib/adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
)
})
})
Expand Down

0 comments on commit c6d4136

Please sign in to comment.