update tests
This commit is contained in:
1 parent
458442f364
commit
da92b9d067
7 files changed
+10
-10
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
import { jest } from "@jest/globals";
|
import { jest } from "@jest/globals";
|
||||||
import { SuperSimpleQueueHelper } from "../../src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.ts";
|
import { QueueHelper } from "../../src/service/infrastructure/JobQueues/QueueHelper.ts";
|
||||||
import { StatusService } from "../../src/service/infrastructure/statusService.ts";
|
import { StatusService } from "../../src/service/infrastructure/statusService.ts";
|
||||||
import { IncidentService } from "../../src/service/business/incidentService.ts";
|
import { IncidentService } from "../../src/service/business/incidentService.ts";
|
||||||
import { InMemoryMonitorsRepository } from "./InMemoryMonitorsRepository.ts";
|
import { InMemoryMonitorsRepository } from "./InMemoryMonitorsRepository.ts";
|
||||||
@@ -143,7 +143,7 @@ export function createHeartbeatTestHarness(): HeartbeatTestHarness {
|
|||||||
|
|
||||||
const maintenanceWindowsRepo = { findByMonitorId: jest.fn().mockResolvedValue([]) };
|
const maintenanceWindowsRepo = { findByMonitorId: jest.fn().mockResolvedValue([]) };
|
||||||
|
|
||||||
const helper = new SuperSimpleQueueHelper(
|
const helper = new QueueHelper(
|
||||||
logger,
|
logger,
|
||||||
networkService as any,
|
networkService as any,
|
||||||
statusService as any,
|
statusService as any,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createMockLogger } from "../helpers/createMockLogger.ts";
|
|||||||
import type { IMonitorsRepository, IUsersRepository } from "../../src/repositories/index.ts";
|
import type { IMonitorsRepository, IUsersRepository } from "../../src/repositories/index.ts";
|
||||||
import type { INotificationMessageBuilder } from "../../src/service/infrastructure/notificationMessageBuilder.ts";
|
import type { INotificationMessageBuilder } from "../../src/service/infrastructure/notificationMessageBuilder.ts";
|
||||||
import type { Monitor } from "../../src/types/monitor.ts";
|
import type { Monitor } from "../../src/types/monitor.ts";
|
||||||
import type { MonitorActionDecision } from "../../src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.ts";
|
import type { MonitorActionDecision } from "../../src/service/infrastructure/JobQueues/QueueHelper.ts";
|
||||||
|
|
||||||
// ── Helpers ──────────────────────────────────────────────────────────────────
|
// ── Helpers ──────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { IIncidentsRepository, IMonitorsRepository, IUsersRepository } from
|
|||||||
import type { INotificationMessageBuilder } from "../../../src/service/infrastructure/notificationMessageBuilder.ts";
|
import type { INotificationMessageBuilder } from "../../../src/service/infrastructure/notificationMessageBuilder.ts";
|
||||||
import type { Monitor } from "../../../src/types/monitor.ts";
|
import type { Monitor } from "../../../src/types/monitor.ts";
|
||||||
import type { Incident } from "../../../src/types/index.ts";
|
import type { Incident } from "../../../src/types/index.ts";
|
||||||
import type { MonitorActionDecision } from "../../../src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.ts";
|
import type { MonitorActionDecision } from "../../../src/service/infrastructure/JobQueues/QueueHelper.ts";
|
||||||
|
|
||||||
// ── Helpers ──────────────────────────────────────────────────────────────────
|
// ── Helpers ──────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, it, beforeEach } from "@jest/globals";
|
import { describe, expect, it, beforeEach } from "@jest/globals";
|
||||||
import { NotificationMessageBuilder } from "../../../src/service/infrastructure/notificationMessageBuilder.ts";
|
import { NotificationMessageBuilder } from "../../../src/service/infrastructure/notificationMessageBuilder.ts";
|
||||||
import type { Monitor, MonitorStatusResponse, HardwareStatusPayload } from "../../../src/types/index.ts";
|
import type { Monitor, MonitorStatusResponse, HardwareStatusPayload } from "../../../src/types/index.ts";
|
||||||
import type { MonitorActionDecision } from "../../../src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.ts";
|
import type { MonitorActionDecision } from "../../../src/service/infrastructure/JobQueues/QueueHelper.ts";
|
||||||
|
|
||||||
// ── Helpers ──────────────────────────────────────────────────────────────────
|
// ── Helpers ──────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { describe, expect, it, jest, beforeEach } from "@jest/globals";
|
|||||||
import { NotificationsService } from "../../../src/service/infrastructure/notificationsService.ts";
|
import { NotificationsService } from "../../../src/service/infrastructure/notificationsService.ts";
|
||||||
import { createMockLogger } from "../../helpers/createMockLogger.ts";
|
import { createMockLogger } from "../../helpers/createMockLogger.ts";
|
||||||
import type { Notification, Monitor, MonitorStatusResponse } from "../../../src/types/index.ts";
|
import type { Notification, Monitor, MonitorStatusResponse } from "../../../src/types/index.ts";
|
||||||
import type { MonitorActionDecision } from "../../../src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.ts";
|
import type { MonitorActionDecision } from "../../../src/service/infrastructure/JobQueues/QueueHelper.ts";
|
||||||
|
|
||||||
// ── Helpers ──────────────────────────────────────────────────────────────────
|
// ── Helpers ──────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ jest.unstable_mockModule("super-simple-scheduler", () => ({
|
|||||||
default: MockScheduler,
|
default: MockScheduler,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const { SuperSimpleQueue } = await import("../../../src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueue.ts");
|
const { SuperSimpleQueue } = await import("../../../src/service/infrastructure/JobQueues/SuperSimpleQueue.ts");
|
||||||
|
|
||||||
const createQueueHelper = () => ({
|
const createQueueHelper = () => ({
|
||||||
getHeartbeatJob: jest.fn().mockReturnValue(() => Promise.resolve()),
|
getHeartbeatJob: jest.fn().mockReturnValue(() => Promise.resolve()),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it, jest } from "@jest/globals";
|
import { describe, expect, it, jest } from "@jest/globals";
|
||||||
import { SuperSimpleQueueHelper } from "../../../src/service/infrastructure/SuperSimpleQueue/SuperSimpleQueueHelper.ts";
|
import { QueueHelper } from "../../../src/service/infrastructure/JobQueues/QueueHelper.ts";
|
||||||
import type { Monitor } from "../../../src/types/monitor.ts";
|
import type { Monitor } from "../../../src/types/monitor.ts";
|
||||||
import { createMockLogger } from "../../helpers/createMockLogger.ts";
|
import { createMockLogger } from "../../helpers/createMockLogger.ts";
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ const createHelper = (overrides?: Record<string, unknown>) => {
|
|||||||
...overrides,
|
...overrides,
|
||||||
};
|
};
|
||||||
|
|
||||||
const helper = new SuperSimpleQueueHelper(
|
const helper = new QueueHelper(
|
||||||
defaults.logger as any,
|
defaults.logger as any,
|
||||||
defaults.networkService as any,
|
defaults.networkService as any,
|
||||||
defaults.statusService as any,
|
defaults.statusService as any,
|
||||||
@@ -94,7 +94,7 @@ const makeMonitor = (overrides?: Partial<Monitor>): Monitor =>
|
|||||||
|
|
||||||
// ── Tests ────────────────────────────────────────────────────────────────────
|
// ── Tests ────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
describe("SuperSimpleQueueHelper", () => {
|
describe("QueueHelper", () => {
|
||||||
describe("serviceName", () => {
|
describe("serviceName", () => {
|
||||||
it("returns JobQueueHelper", () => {
|
it("returns JobQueueHelper", () => {
|
||||||
const { helper } = createHelper();
|
const { helper } = createHelper();
|
||||||
|
|||||||
Reference in new issue
Block a user