Skip to content

Commit

Permalink
chore: make native eventbus configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoenig134 committed Dec 2, 2024
1 parent 95dc437 commit b088053
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/app-runtime/test/lib/natives/FakeNativeBootstrapper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventEmitter2EventBus, Result } from "@js-soft/ts-utils";
import { EventBus, EventEmitter2EventBus, Result } from "@js-soft/ts-utils";
import { WebLoggerFactory } from "@js-soft/web-logger";
import { INativeBootstrapper, INativeEnvironment } from "../../../src";
import { FakeNativeConfigAccess } from "./FakeNativeConfigAccess";
Expand All @@ -7,6 +7,8 @@ import { FakeNativeDeviceInfoAccess } from "./FakeNativeDeviceInfoAccess";
import { FakeNativeNotificationAccess } from "./FakeNativeNotificationAccess";

export class FakeNativeBootstrapper implements INativeBootstrapper {
public constructor(private readonly eventBus?: EventBus) {}

private _nativeEnvironment: INativeEnvironment;
public get nativeEnvironment(): INativeEnvironment {
return this._nativeEnvironment;
Expand All @@ -24,9 +26,11 @@ export class FakeNativeBootstrapper implements INativeBootstrapper {
configAccess: new FakeNativeConfigAccess(),
databaseFactory: new FakeNativeDatabaseFactory(),
deviceInfoAccess: new FakeNativeDeviceInfoAccess(),
eventBus: new EventEmitter2EventBus(() => {
// noop
}),
eventBus:
this.eventBus ??
new EventEmitter2EventBus(() => {
// noop
}),
loggerFactory,
notificationAccess: new FakeNativeNotificationAccess(nativeLogger)
};
Expand Down

0 comments on commit b088053

Please sign in to comment.