mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
update method to set up test server context
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user