From 34322a6523c34d2bde65e63b5d733befe86322da Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Thu, 13 Dec 2018 16:38:22 +0200 Subject: [PATCH] tests: Use an empty `subscriptionsPath` when asserting subscriptions eq false. This fixes a TypeScript `TypeError` which was encountered after the `@types/ws` typings were updated[[1]] to more correctly identify valid URLs. The error exhibited on CI[[2] was: TypeError [ERR_INVALID_URL]: Invalid URL: ws://localhost:6666undefined This had been previously reverted[[3]] but was auto-merged again for a reason I don't quite have time to investigate right now, though I suspect it's something I'll be able to prevent in the future with a bit more care. [1]: https://github.com/apollographql/apollo-server/pull/1992 [2]: https://circleci.com/gh/apollographql/apollo-server/22416 [3]: https://github.com/apollographql/apollo-server/pull/2006 cc @martijnwalraven --- .../apollo-server-integration-testsuite/src/ApolloServer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/apollo-server-integration-testsuite/src/ApolloServer.ts b/packages/apollo-server-integration-testsuite/src/ApolloServer.ts index 4cd7156b3b5..750e4a5beaf 100644 --- a/packages/apollo-server-integration-testsuite/src/ApolloServer.ts +++ b/packages/apollo-server-integration-testsuite/src/ApolloServer.ts @@ -978,7 +978,7 @@ export function testApolloServer( }); }); }); - it('disables subscritpions when option set to false', done => { + it('disables subscriptions when option set to false', done => { const typeDefs = gql` type Query { "graphql-js forces there to be a query type" @@ -1025,7 +1025,7 @@ export function testApolloServer( } const client = new SubscriptionClient( - `ws://localhost:${port}${server.subscriptionsPath}`, + `ws://localhost:${port}${server.subscriptionsPath || ''}`, {}, WebSocket, );