mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +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 { ServerContext } from "../../src/ServerContext";
|
||||||
import { ETANotificationScheduler } from "../../src/notifications/schedulers/ETANotificationScheduler";
|
import { ETANotificationScheduler } from "../../src/notifications/schedulers/ETANotificationScheduler";
|
||||||
import { InMemoryNotificationRepository } from "../../src/repositories/InMemoryNotificationRepository";
|
import { InMemoryNotificationRepository } from "../../src/repositories/InMemoryNotificationRepository";
|
||||||
|
import { InterchangeSystem } from "../../src/entities/InterchangeSystem";
|
||||||
|
|
||||||
|
|
||||||
function setUpTestServer() {
|
function setUpTestServer() {
|
||||||
@@ -25,9 +26,17 @@ function setUpTestServer() {
|
|||||||
export function setupTestServerContext() {
|
export function setupTestServerContext() {
|
||||||
const context: { [key: string] : any } = {};
|
const context: { [key: string] : any } = {};
|
||||||
|
|
||||||
|
const systems = [
|
||||||
|
InterchangeSystem.build(
|
||||||
|
{
|
||||||
|
id: "1", name: "Chapman University", passioSystemId: "263"
|
||||||
|
},
|
||||||
|
new InMemoryNotificationRepository()
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
context.shuttleRepository = new UnoptimizedInMemoryShuttleRepository();
|
context.systems = systems;
|
||||||
context.notificationRepository = new InMemoryNotificationRepository();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return context as ServerContext;
|
return context as ServerContext;
|
||||||
|
|||||||
Reference in New Issue
Block a user