thunderhub/server/tests/testServer.ts
Anthony Potdevin a78b6e96d5
test: 🚨 more server unit tests (#70)
* chore: 🔧 add tests

* fix: 🐛 network info resolver

* feat:  init tests

* chore: 🔧 improve test

* chore: 🔧 more tests

* chore: 🔧 bitcoin resolvers

* chore: 🔧 more tests
2020-06-13 11:46:20 +02:00

13 lines
400 B
TypeScript

import {
createTestClient,
ApolloServerTestClient,
} from 'apollo-server-testing';
import { ApolloServer } from 'apollo-server';
import schema from 'server/schema';
import { ContextMock } from 'server/tests/testMocks';
export default function testServer(context?: any): ApolloServerTestClient {
return createTestClient(
new ApolloServer({ schema, context: context || ContextMock })
);
}