remove unused getters
This commit is contained in:
1 parent
c961f5292d
commit
586e79efb2
45 files changed
-262
No files matched your search
@@ -50,10 +50,6 @@ class AuthController implements IAuthController {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return AuthController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
registerUser = catchAsync(async (req: Request, res: Response) => {
|
||||
const newUser = req.body.user;
|
||||
const newUserToken = req.body.token;
|
||||
|
||||
@@ -14,7 +14,6 @@ import { requireTeamId } from "@/api/controllers/controllerUtils.js";
|
||||
const SERVICE_NAME = "checkController";
|
||||
|
||||
export interface ICheckController {
|
||||
serviceName: string;
|
||||
getChecksByMonitor: RequestHandler;
|
||||
getChecksByTeam: RequestHandler;
|
||||
getChecksSummaryByTeamId: RequestHandler;
|
||||
@@ -30,10 +29,6 @@ class CheckController implements ICheckController {
|
||||
this.checkService = checkService;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return CheckController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
getChecksByMonitor = catchAsync(async (req: Request, res: Response) => {
|
||||
const validatedParams = getChecksParamValidation.parse(req.params);
|
||||
const validatedQuery = getChecksQueryValidation.parse(req.query);
|
||||
|
||||
@@ -17,10 +17,6 @@ class DiagnosticController implements IDiagnosticController {
|
||||
this.diagnosticService = diagnosticService;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return DiagnosticController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
getSystemStats = catchAsync(async (req: Request, res: Response) => {
|
||||
const diagnostics = await this.diagnosticService.getSystemStats();
|
||||
return res.status(200).json({
|
||||
|
||||
@@ -17,10 +17,6 @@ class GeoCheckController implements IGeoCheckController {
|
||||
this.geoChecksService = geoChecksService;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return GeoCheckController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
getGeoChecksByMonitor = catchAsync(async (req: Request, res: Response) => {
|
||||
const validatedParams = getChecksParamValidation.parse(req.params);
|
||||
const validatedQuery = getChecksQueryValidation.parse(req.query);
|
||||
|
||||
@@ -18,10 +18,6 @@ class InviteController implements IInviteController {
|
||||
this.inviteService = inviteService;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return InviteController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
getInviteToken = catchAsync(async (req: Request, res: Response) => {
|
||||
const teamId = requireTeamId(req.user?.teamId);
|
||||
const userRoles = requireUserRoles(req.user?.role);
|
||||
|
||||
@@ -14,9 +14,6 @@ class LogController {
|
||||
constructor(logger: ILogger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
get serviceName() {
|
||||
return LogController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
getLogs = catchAsync(async (req: Request, res: Response) => {
|
||||
const logs = this.logger.getLogs();
|
||||
|
||||
@@ -57,10 +57,6 @@ class MonitorController implements IMonitorController {
|
||||
this.notificationsService = notificationsService;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return MonitorController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
getMonitorCertificate = catchAsync(async (req: Request, res: Response) => {
|
||||
const validatedParams = getCertificateParamValidation.parse(req.params);
|
||||
const teamId = requireTeamId(req.user?.teamId);
|
||||
|
||||
@@ -16,10 +16,6 @@ class JobQueueController implements IJobQueueController {
|
||||
static SERVICE_NAME = SERVICE_NAME;
|
||||
constructor(private scheduler: IJobScheduler) {}
|
||||
|
||||
get serviceName() {
|
||||
return JobQueueController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
getMetrics = catchAsync(async (req: Request, res: Response) => {
|
||||
const metrics = await this.scheduler.getMetrics();
|
||||
res.status(200).json({
|
||||
|
||||
@@ -10,7 +10,6 @@ import { Settings } from "@/domain/app-settings/app-settings.type.js";
|
||||
const SERVICE_NAME = "SettingsController";
|
||||
|
||||
export interface ISettingsController {
|
||||
serviceName: string;
|
||||
getAppSettings: RequestHandler;
|
||||
updateAppSettings: RequestHandler;
|
||||
sendTestEmail: RequestHandler;
|
||||
@@ -25,10 +24,6 @@ class SettingsController implements ISettingsController {
|
||||
this.emailService = emailService;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return SettingsController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
buildAppSettings = (dbSettings: Settings) => {
|
||||
const sanitizedSettings: Record<string, unknown> = { ...dbSettings };
|
||||
delete sanitizedSettings.version;
|
||||
|
||||
@@ -16,7 +16,6 @@ import { resolveStatusPageDomainFromRequest } from "@/utils/statusPageDomain.js"
|
||||
const SERVICE_NAME = "statusPageController";
|
||||
|
||||
export interface IStatusPageController {
|
||||
readonly serviceName: string;
|
||||
createStatusPage: RequestHandler;
|
||||
updateStatusPage: RequestHandler;
|
||||
getStatusPageByUrl: RequestHandler;
|
||||
@@ -32,10 +31,6 @@ class StatusPageController implements IStatusPageController {
|
||||
this.statusPageService = statusPageService;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return StatusPageController.SERVICE_NAME;
|
||||
}
|
||||
|
||||
createStatusPage = catchAsync(async (req: Request, res: Response) => {
|
||||
createStatusPageBodyValidation.parse(req.body);
|
||||
if (req.file) {
|
||||
|
||||
@@ -21,10 +21,6 @@ class MongoDB implements IDb<Mongoose> {
|
||||
this.db = null;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return MongoDB.SERVICE_NAME;
|
||||
}
|
||||
|
||||
connect = async () => {
|
||||
try {
|
||||
const connectionString = this.envSettings.dbConnectionString || "mongodb://localhost:27017/uptime_db";
|
||||
|
||||
@@ -20,7 +20,6 @@ export type EnvConfig = {
|
||||
};
|
||||
|
||||
export interface ISettingsService {
|
||||
readonly serviceName: string;
|
||||
loadSettings(): EnvConfig;
|
||||
getSettings(): EnvConfig;
|
||||
areStatusPageThemesEnabled(): boolean;
|
||||
@@ -57,10 +56,6 @@ export class SettingsService implements ISettingsService {
|
||||
this.settingsRepository = settingsRepository;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return SettingsService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
loadSettings() {
|
||||
return this.settings;
|
||||
}
|
||||
|
||||
@@ -50,10 +50,6 @@ export class CheckService implements ICheckService {
|
||||
this.checksRepository = checksRepository;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return CheckService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
createChecks = async (checks: Check[]) => {
|
||||
return this.checksRepository.createChecks(checks);
|
||||
};
|
||||
|
||||
@@ -79,10 +79,6 @@ export class DiagnosticService implements IDiagnosticService {
|
||||
obs.observe({ entryTypes: ["measure"] });
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return DiagnosticService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
private getCPUUsagePercentage = async (): Promise<number> => {
|
||||
const startUsage = process.cpuUsage();
|
||||
const timingPeriod = 1000; // measured in ms
|
||||
|
||||
@@ -11,7 +11,6 @@ import { AppError } from "@/utils/AppError.js";
|
||||
const SERVICE_NAME = "GeoChecksService";
|
||||
|
||||
export interface IGeoChecksService {
|
||||
readonly serviceName: string;
|
||||
buildGeoCheck(monitor: Monitor): Promise<GeoCheck | null>;
|
||||
createGeoChecks(geoChecks: GeoCheck[]): Promise<GeoCheck[]>;
|
||||
getGeoChecksByMonitor(args: {
|
||||
@@ -50,10 +49,6 @@ export class GeoChecksService implements IGeoChecksService {
|
||||
this.monitorsRepository = monitorsRepository;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return GeoChecksService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
async buildGeoCheck(monitor: Monitor): Promise<GeoCheck | null> {
|
||||
try {
|
||||
if (!monitor.url) {
|
||||
|
||||
@@ -57,10 +57,6 @@ export class IncidentService implements IIncidentService {
|
||||
this.notificationMessageBuilder = notificationMessageBuilder;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return IncidentService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
handleIncident = async (
|
||||
monitor: Monitor,
|
||||
code: number,
|
||||
|
||||
@@ -35,10 +35,6 @@ export class InviteService implements IInviteService {
|
||||
this.emailService = emailService;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return InviteService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
getInviteToken = async ({ invite, teamId, userRoles }: { invite: Partial<Invite>; teamId: string; userRoles: UserRole[] }) => {
|
||||
invite.teamId = teamId;
|
||||
|
||||
|
||||
@@ -62,10 +62,6 @@ export class MaintenanceWindowService implements IMaintenanceWindowService {
|
||||
this.scheduler = scheduler;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return MaintenanceWindowService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
private flipMonitorsLeavingMaintenance = async (monitorIds: string[], teamId: string, excludeWindowId: string, now: Date): Promise<void> => {
|
||||
if (monitorIds.length === 0) return;
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ const isUptimeChecksResult = (result: UptimeChecksResult | HardwareChecksResult
|
||||
supportsUptimeDetails(result.monitorType);
|
||||
|
||||
export interface IMonitorService {
|
||||
readonly serviceName: string;
|
||||
|
||||
// create
|
||||
createMonitor(teamId: string, userId: string, body: Partial<Monitor>): Promise<void>;
|
||||
createMonitors(monitors: Array<Monitor>): Promise<Monitor[] | null>;
|
||||
@@ -135,10 +133,6 @@ export class MonitorService implements IMonitorService {
|
||||
this.incidentsRepository = incidentsRepository;
|
||||
}
|
||||
|
||||
get serviceName(): string {
|
||||
return MonitorService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
private getDateRange = (dateRange: DateRangeKey) => {
|
||||
const startDates = {
|
||||
recent: new Date(new Date().setHours(new Date().getHours() - 2)),
|
||||
|
||||
@@ -103,10 +103,6 @@ export class UserService implements IUserService {
|
||||
this.teamsRepository = teamsRepository;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return UserService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
issueToken = (payload: Partial<User>, appSettings: EnvConfig) => {
|
||||
return this.jwt.sign(payload, appSettings.jwtSecret, { expiresIn: appSettings.jwtTTL });
|
||||
};
|
||||
|
||||
@@ -51,10 +51,6 @@ export class BufferService implements IBufferService {
|
||||
});
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return BufferService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
addToBuffer(check: Check) {
|
||||
try {
|
||||
this.buffer.push(check);
|
||||
|
||||
@@ -56,10 +56,6 @@ export class EmailService implements IEmailService {
|
||||
this.init();
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return EmailService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
init = () => {
|
||||
const loadTemplate = (templateName: string) => {
|
||||
try {
|
||||
|
||||
@@ -61,7 +61,6 @@ interface GlobalPingProbeResult {
|
||||
}
|
||||
|
||||
export interface IGlobalPingService {
|
||||
readonly serviceName: string;
|
||||
createMeasurement(monitorType: MonitorType, url: string, locations: GeoContinent[]): Promise<string | null>;
|
||||
pollForResults(measurementId: string, timeoutMs?: number, customUpCodes?: HttpStatusCode[]): Promise<GeoCheckResult[]>;
|
||||
}
|
||||
@@ -75,10 +74,6 @@ export class GlobalPingService implements IGlobalPingService {
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return GlobalPingService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
async createMeasurement(monitorType: MonitorType, url: string, locations: GeoContinent[]): Promise<string | null> {
|
||||
try {
|
||||
if (!supportsGeoCheck(monitorType)) {
|
||||
|
||||
@@ -8,7 +8,6 @@ import { IStatusProvider } from "./network/IStatusProvider.js";
|
||||
const SERVICE_NAME = "NetworkService";
|
||||
|
||||
export interface INetworkService {
|
||||
readonly serviceName: string;
|
||||
requestStatus<T extends MonitorType>(monitor: Monitor & { type: T }): Promise<MonitorStatusResponse<MonitorPayloadMap[T]>>;
|
||||
requestWebhook(
|
||||
type: string,
|
||||
@@ -39,10 +38,6 @@ export class NetworkService implements INetworkService {
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
get serviceName(): string {
|
||||
return NetworkService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
// Main entry point
|
||||
async requestStatus<T extends MonitorType>(monitor: Monitor & { type: T }): Promise<MonitorStatusResponse<MonitorPayloadMap[T]>> {
|
||||
const provider = this.providers.find((p) => p.supports(monitor.type));
|
||||
|
||||
@@ -57,10 +57,6 @@ export class StatusService implements IStatusService {
|
||||
this.monitorStatsRepository = monitorStatsRepository;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return StatusService.SERVICE_NAME;
|
||||
}
|
||||
|
||||
async updateRunningStats(monitor: Monitor, networkResponse: MonitorStatusResponse) {
|
||||
try {
|
||||
await this.monitorStatsRepository.updateByMonitorId(monitor.id, {
|
||||
|
||||
@@ -19,7 +19,6 @@ interface LogEntry extends LogConfig {
|
||||
}
|
||||
|
||||
export interface ILogger {
|
||||
readonly serviceName: string;
|
||||
info(config: LogConfig): void;
|
||||
warn(config: LogConfig): void;
|
||||
error(config: LogConfig): void;
|
||||
@@ -97,10 +96,6 @@ class Logger implements ILogger {
|
||||
});
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return Logger.SERVICE_NAME;
|
||||
}
|
||||
|
||||
info(config: LogConfig) {
|
||||
const logEntry = this.buildLogEntry("info", config);
|
||||
this.cacheLog(logEntry);
|
||||
|
||||
@@ -95,10 +95,6 @@ export class DBQueueWorker extends JobScheduler implements IQueueWorker {
|
||||
this.isDbConnected = dependencies.isDbConnected;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return DBQueueWorker.SERVICE_NAME;
|
||||
}
|
||||
|
||||
static async create(dependencies: DBQueueWorkerDependencies): Promise<DBQueueWorker> {
|
||||
const instance = new DBQueueWorker(dependencies);
|
||||
await instance.init();
|
||||
|
||||
@@ -12,7 +12,6 @@ import { ITeamsRepository } from "@/domain/teams/team.repository.interface.js";
|
||||
import { ILogger } from "@/utils/logger.js";
|
||||
|
||||
export interface IWorkerHelper {
|
||||
readonly serviceName: string;
|
||||
getCleanupOrphanedJob(): () => Promise<void>;
|
||||
getCleanupRetentionJob(): () => Promise<void>;
|
||||
}
|
||||
@@ -69,10 +68,6 @@ export class WorkerHelper implements IWorkerHelper {
|
||||
this.geoChecksRepository = geoChecksRepository;
|
||||
}
|
||||
|
||||
get serviceName() {
|
||||
return WorkerHelper.SERVICE_NAME;
|
||||
}
|
||||
|
||||
getCleanupOrphanedJob = () => {
|
||||
return async () => {
|
||||
try {
|
||||
|
||||
@@ -67,7 +67,6 @@ export type WorkerHealth = {
|
||||
inFlight: number; // total in-flight jobs across types
|
||||
};
|
||||
export interface IJobScheduler {
|
||||
readonly serviceName: string;
|
||||
addJob(monitorId: string, monitor: Monitor): Promise<void>;
|
||||
deleteJob(monitor: Monitor): Promise<void>;
|
||||
pauseJob(monitor: Monitor): Promise<void>;
|
||||
@@ -83,7 +82,6 @@ export interface IJobScheduler {
|
||||
}
|
||||
|
||||
export interface IQueueWorker extends IJobScheduler {
|
||||
readonly serviceName: string;
|
||||
getHealth(): WorkerHealth;
|
||||
countDueBacklog(): Promise<number>;
|
||||
countAliveWorkers(): Promise<number>;
|
||||
|
||||
@@ -26,9 +26,6 @@ export class JobScheduler implements IJobScheduler {
|
||||
protected readonly workerId: string // same id MongoJobsRepository stamps into lockedBy
|
||||
) {}
|
||||
|
||||
get serviceName() {
|
||||
return JobScheduler.SERVICE_NAME;
|
||||
}
|
||||
private heartbeatInFlight: Promise<void> = Promise.resolve();
|
||||
|
||||
protected processesJobs = false; // scheduler-only by default; DBQueueWorker flips this on when it runs job loops
|
||||
|
||||
@@ -71,17 +71,6 @@ describe("BufferService", () => {
|
||||
|
||||
// ── Static / instance properties ─────────────────────────────────────
|
||||
|
||||
describe("serviceName", () => {
|
||||
it("returns BufferService from static property", () => {
|
||||
expect(BufferService.SERVICE_NAME).toBe("BufferService");
|
||||
});
|
||||
|
||||
it("returns BufferService from instance getter", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("BufferService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── constructor ──────────────────────────────────────────────────────
|
||||
|
||||
describe("constructor", () => {
|
||||
|
||||
@@ -48,13 +48,6 @@ const makeStatusResponse = (overrides?: Partial<MonitorStatusResponse>): Monitor
|
||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe("CheckService", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns checkService", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("checkService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── toCheck ──────────────────────────────────────────────────────────────
|
||||
|
||||
describe("toCheck", () => {
|
||||
|
||||
@@ -56,17 +56,6 @@ describe("DiagnosticService", () => {
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
describe("serviceName", () => {
|
||||
it("returns diagnosticService from static property", () => {
|
||||
expect(DiagnosticService.SERVICE_NAME).toBe("diagnosticService");
|
||||
});
|
||||
|
||||
it("returns diagnosticService from instance getter", () => {
|
||||
const service = new DiagnosticService(makeDb());
|
||||
expect(service.serviceName).toBe("diagnosticService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── constructor ─────────────────────────────────────────────────────────
|
||||
|
||||
describe("constructor", () => {
|
||||
|
||||
@@ -82,11 +82,6 @@ describe("EmailService", () => {
|
||||
it("returns EmailService from static property", () => {
|
||||
expect(EmailService.SERVICE_NAME).toBe("EmailService");
|
||||
});
|
||||
|
||||
it("returns EmailService from instance getter", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("EmailService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── init / loadTemplate ──────────────────────────────────────────────
|
||||
|
||||
@@ -48,17 +48,6 @@ const createService = (overrides?: Record<string, unknown>) => {
|
||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe("GeoChecksService", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns GeoChecksService from static property", () => {
|
||||
expect(GeoChecksService.SERVICE_NAME).toBe("GeoChecksService");
|
||||
});
|
||||
|
||||
it("returns GeoChecksService from instance getter", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("GeoChecksService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── buildGeoCheck ───────────────────────────────────────────────────────
|
||||
|
||||
describe("buildGeoCheck", () => {
|
||||
|
||||
@@ -66,17 +66,6 @@ describe("GlobalPingService", () => {
|
||||
|
||||
// ── Static / instance properties ─────────────────────────────────────
|
||||
|
||||
describe("serviceName", () => {
|
||||
it("returns GlobalPingService from static property", () => {
|
||||
expect(GlobalPingService.SERVICE_NAME).toBe("GlobalPingService");
|
||||
});
|
||||
|
||||
it("returns GlobalPingService from instance getter", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("GlobalPingService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── createMeasurement ────────────────────────────────────────────────
|
||||
|
||||
describe("createMeasurement", () => {
|
||||
|
||||
@@ -91,13 +91,6 @@ const makeDecision = (overrides?: Partial<MonitorActionDecision>): MonitorAction
|
||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe("IncidentService", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns incidentService", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("incidentService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── handleIncident ───────────────────────────────────────────────────────
|
||||
|
||||
describe("handleIncident", () => {
|
||||
|
||||
@@ -39,17 +39,6 @@ const createService = (overrides?: Record<string, unknown>) => {
|
||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe("InviteService", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns inviteService from static property", () => {
|
||||
expect(InviteService.SERVICE_NAME).toBe("inviteService");
|
||||
});
|
||||
|
||||
it("returns inviteService from instance getter", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("inviteService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── getInviteToken ──────────────────────────────────────────────────────
|
||||
|
||||
describe("getInviteToken", () => {
|
||||
|
||||
@@ -94,17 +94,6 @@ const defaultCreateParams = {
|
||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe("MaintenanceWindowService", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns maintenanceWindowService from static property", () => {
|
||||
expect(MaintenanceWindowService.SERVICE_NAME).toBe("maintenanceWindowService");
|
||||
});
|
||||
|
||||
it("returns maintenanceWindowService from instance getter", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("maintenanceWindowService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── createMaintenanceWindow ──────────────────────────────────────────────
|
||||
|
||||
describe("createMaintenanceWindow", () => {
|
||||
|
||||
@@ -111,13 +111,6 @@ const createService = (
|
||||
};
|
||||
|
||||
describe("MonitorService", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns 'MonitorService'", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("MonitorService");
|
||||
});
|
||||
});
|
||||
|
||||
describe("createMonitor", () => {
|
||||
it("creates a monitor and adds a job", async () => {
|
||||
const monitorsRepository = createMonitorsRepositoryMock();
|
||||
|
||||
@@ -43,17 +43,6 @@ const createService = (providers: IStatusProvider<unknown>[] = []) => {
|
||||
describe("NetworkService", () => {
|
||||
// ── Static / instance properties ─────────────────────────────────────────
|
||||
|
||||
describe("serviceName", () => {
|
||||
it("returns NetworkService from static property", () => {
|
||||
expect(NetworkService.SERVICE_NAME).toBe("NetworkService");
|
||||
});
|
||||
|
||||
it("returns NetworkService from instance getter", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("NetworkService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── requestStatus ────────────────────────────────────────────────────────
|
||||
|
||||
describe("requestStatus", () => {
|
||||
|
||||
@@ -56,17 +56,6 @@ const createService = (envOverrides?: Partial<ValidatedEnv>) => {
|
||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe("SettingsService", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns SettingsService from static property", () => {
|
||||
expect(SettingsService.SERVICE_NAME).toBe("SettingsService");
|
||||
});
|
||||
|
||||
it("returns SettingsService from instance getter", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("SettingsService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── loadSettings ────────────────────────────────────────────────────────
|
||||
|
||||
describe("loadSettings", () => {
|
||||
|
||||
@@ -143,13 +143,6 @@ const makeExistingStats = (overrides?: Record<string, unknown>) => ({
|
||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe("StatusService", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns StatusService", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("StatusService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── updateRunningStats ───────────────────────────────────────────────────
|
||||
|
||||
describe("updateRunningStats", () => {
|
||||
|
||||
@@ -98,13 +98,6 @@ const createService = (overrides?: Record<string, unknown>) => {
|
||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe("UserService", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns userService", () => {
|
||||
const { service } = createService();
|
||||
expect(service.serviceName).toBe("userService");
|
||||
});
|
||||
});
|
||||
|
||||
// ── issueToken ──────────────────────────────────────────────────────────
|
||||
|
||||
describe("issueToken", () => {
|
||||
|
||||
@@ -71,13 +71,6 @@ const createHelper = (overrides?: Record<string, unknown>) => {
|
||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe("WorkerHelper", () => {
|
||||
describe("serviceName", () => {
|
||||
it("returns JobQueueHelper", () => {
|
||||
const { helper } = createHelper();
|
||||
expect(helper.serviceName).toBe("JobQueueHelper");
|
||||
});
|
||||
});
|
||||
|
||||
// ── getCleanupOrphanedJob ────────────────────────────────────────────────
|
||||
|
||||
describe("getCleanupOrphanedJob", () => {
|
||||
|
||||
Reference in new issue
Block a user