(_parseServer, parseGraphQLServerOptions)
| 440 | } |
| 441 | |
| 442 | async function createGQLFromParseServer(_parseServer, parseGraphQLServerOptions) { |
| 443 | if (parseLiveQueryServer) { |
| 444 | await parseLiveQueryServer.server.close(); |
| 445 | } |
| 446 | if (httpServer) { |
| 447 | await httpServer.close(); |
| 448 | } |
| 449 | const expressApp = express(); |
| 450 | httpServer = http.createServer(expressApp); |
| 451 | expressApp.use('/parse', _parseServer.app); |
| 452 | parseLiveQueryServer = await ParseServer.createLiveQueryServer(httpServer, { |
| 453 | port: 1338, |
| 454 | }); |
| 455 | parseGraphQLServer = new ParseGraphQLServer(_parseServer, { |
| 456 | graphQLPath: '/graphql', |
| 457 | playgroundPath: '/playground', |
| 458 | ...parseGraphQLServerOptions, |
| 459 | }); |
| 460 | parseGraphQLServer.applyGraphQL(expressApp); |
| 461 | parseGraphQLServer.applyPlayground(expressApp); |
| 462 | await new Promise(resolve => httpServer.listen({ port: 13377 }, resolve)); |
| 463 | } |
| 464 | |
| 465 | beforeEach(async () => { |
| 466 | await createGQLFromParseServer(parseServer); |
no test coverage detected