Skip to content

Commit b088053

Browse files
committed
chore: make native eventbus configurable
1 parent 95dc437 commit b088053

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/app-runtime/test/lib/natives/FakeNativeBootstrapper.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventEmitter2EventBus, Result } from "@js-soft/ts-utils";
1+
import { EventBus, EventEmitter2EventBus, Result } from "@js-soft/ts-utils";
22
import { WebLoggerFactory } from "@js-soft/web-logger";
33
import { INativeBootstrapper, INativeEnvironment } from "../../../src";
44
import { FakeNativeConfigAccess } from "./FakeNativeConfigAccess";
@@ -7,6 +7,8 @@ import { FakeNativeDeviceInfoAccess } from "./FakeNativeDeviceInfoAccess";
77
import { FakeNativeNotificationAccess } from "./FakeNativeNotificationAccess";
88

99
export class FakeNativeBootstrapper implements INativeBootstrapper {
10+
public constructor(private readonly eventBus?: EventBus) {}
11+
1012
private _nativeEnvironment: INativeEnvironment;
1113
public get nativeEnvironment(): INativeEnvironment {
1214
return this._nativeEnvironment;
@@ -24,9 +26,11 @@ export class FakeNativeBootstrapper implements INativeBootstrapper {
2426
configAccess: new FakeNativeConfigAccess(),
2527
databaseFactory: new FakeNativeDatabaseFactory(),
2628
deviceInfoAccess: new FakeNativeDeviceInfoAccess(),
27-
eventBus: new EventEmitter2EventBus(() => {
28-
// noop
29-
}),
29+
eventBus:
30+
this.eventBus ??
31+
new EventEmitter2EventBus(() => {
32+
// noop
33+
}),
3034
loggerFactory,
3135
notificationAccess: new FakeNativeNotificationAccess(nativeLogger)
3236
};

0 commit comments

Comments
 (0)