From 623886ecf9496989fba9314ec68b5c59287a172e Mon Sep 17 00:00:00 2001 From: b4rtaz Date: Mon, 24 Apr 2023 11:18:58 +0200 Subject: [PATCH] streams fix. --- packages/streams/src/Streams.test.ts | 20 ++++++++++++++++++++ packages/streams/src/Streams.ts | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 packages/streams/src/Streams.test.ts diff --git a/packages/streams/src/Streams.test.ts b/packages/streams/src/Streams.test.ts new file mode 100644 index 0000000000..8dc504a2c6 --- /dev/null +++ b/packages/streams/src/Streams.test.ts @@ -0,0 +1,20 @@ +import { ApiUtils } from '@moralisweb3/api-utils'; +import { Core } from '@moralisweb3/common-core'; +import { Streams } from './Streams'; + +describe('Streams', () => { + function setupStreams() { + const core = Core.create(); + const apiUtils = ApiUtils.create(core); + const streams = Streams.create(core); + core.registerModules([apiUtils, streams]); + + return { core, streams }; + } + + it('returns default baseUrl', () => { + const { streams } = setupStreams(); + + expect(streams.baseUrl).toBe('https://api.moralis-streams.com'); + }); +}); diff --git a/packages/streams/src/Streams.ts b/packages/streams/src/Streams.ts index db798215af..38c6d5f2a0 100644 --- a/packages/streams/src/Streams.ts +++ b/packages/streams/src/Streams.ts @@ -39,7 +39,7 @@ export class Streams extends ApiModule { } private constructor(core: Core) { - super(Streams.moduleName, core, BASE_URL); + super(Streams.moduleName, core, () => BASE_URL); } public setup() {