Skip to content

Commit eb419c6

Browse files
committed
test: fix missing options injection
1 parent 5330207 commit eb419c6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/common/mobile/device-log-provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class DeviceLogProvider extends DeviceLogProviderBase {
8181

8282
private logDataCore(data: string, deviceIdentifier: string): void {
8383
// todo: use config to set logger - --env.classicLogs is temporary!
84-
if ("classicLogs" in this.$options.env) {
84+
if ("classicLogs" in (this.$options.env ?? {})) {
8585
// legacy logging
8686
this.$logger.info(data, { [LoggerConfigData.skipNewLine]: true });
8787
return;

lib/common/test/unit-tests/mobile/device-log-provider.ts

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ const createTestInjector = (): IInjector => {
3131
testInjector.register("iOSLogFilter", IOSLogFilter);
3232
testInjector.register("logger", CommonLoggerStub);
3333
testInjector.register("logSourceMapService", LogSourceMapService);
34+
testInjector.register("options", {
35+
env: {
36+
classicLogs: true,
37+
},
38+
});
3439
testInjector.register("loggingLevels", LoggingLevels);
3540
testInjector.register("devicePlatformsConstants", DevicePlatformsConstants);
3641
testInjector.register("fs", FileSystem);

0 commit comments

Comments
 (0)