update method to set up test server context

This commit is contained in:
2025-04-06 12:56:12 -07:00
parent af57063b15
commit f31e010828

View File

@@ -6,6 +6,7 @@ import { beforeEach } from "@jest/globals";
import { ServerContext } from "../../src/ServerContext";
import { ETANotificationScheduler } from "../../src/notifications/schedulers/ETANotificationScheduler";
import { InMemoryNotificationRepository } from "../../src/repositories/InMemoryNotificationRepository";
import { InterchangeSystem } from "../../src/entities/InterchangeSystem";
function setUpTestServer() {
@@ -25,9 +26,17 @@ function setUpTestServer() {
export function setupTestServerContext() {
const context: { [key: string] : any } = {};
const systems = [
InterchangeSystem.build(
{
id: "1", name: "Chapman University", passioSystemId: "263"
},
new InMemoryNotificationRepository()
),
]
beforeEach(() => {
context.shuttleRepository = new UnoptimizedInMemoryShuttleRepository();
context.notificationRepository = new InMemoryNotificationRepository();
context.systems = systems;
});
return context as ServerContext;