mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
update test helpers to consolidate ServerContext creation into one method
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { beforeEach, describe, expect, it } from "@jest/globals";
|
||||
import { setupTestServerContext } from "../testHelpers/apolloTestServerHelpers";
|
||||
import { setupTestServerContext, setupTestServerHolder } from "../testHelpers/apolloTestServerHelpers";
|
||||
import { IEta, IShuttle, IStop, ISystem } from "../../src/entities/entities";
|
||||
import {
|
||||
addMockEtaToRepository, addMockShuttleToRepository,
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
import assert = require("node:assert");
|
||||
|
||||
describe("EtaResolvers", () => {
|
||||
const holder = setupTestServerHolder();
|
||||
const context = setupTestServerContext();
|
||||
|
||||
let mockSystem: ISystem;
|
||||
@@ -24,7 +25,7 @@ describe("EtaResolvers", () => {
|
||||
});
|
||||
|
||||
async function getResponseForEtaQuery(query: string) {
|
||||
const response = await context.testServer.executeOperation({
|
||||
const response = await holder.testServer.executeOperation({
|
||||
query,
|
||||
variables: {
|
||||
systemId: mockSystem.id,
|
||||
@@ -87,4 +88,4 @@ describe("EtaResolvers", () => {
|
||||
expect(eta.shuttle.id).toEqual(expectedEta.shuttleId);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user