MIF_E31221222/sigap-website/di/modules/monitoring.module.ts

25 lines
774 B
TypeScript

import { createModule } from '@evyweb/ioctopus';
import { DI_SYMBOLS } from '@/di/types';
export function createMonitoringModule() {
const monitoringModule = createModule();
if (process.env.NODE_ENV === 'test') {
monitoringModule
.bind(DI_SYMBOLS.IInstrumentationService)
.toClass(MockInstrumentationService);
monitoringModule
.bind(DI_SYMBOLS.ICrashReporterService)
.toClass(MockCrashReporterService);
} else {
monitoringModule
.bind(DI_SYMBOLS.IInstrumentationService)
.toClass(InstrumentationService);
monitoringModule
.bind(DI_SYMBOLS.ICrashReporterService)
.toClass(CrashReporterService);
}
return monitoringModule;
}