Skip to content

Commit

Permalink
tests: Use an empty subscriptionsPath when asserting subscriptions …
Browse files Browse the repository at this point in the history
…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]: #1992
[2]: https://circleci.com/gh/apollographql/apollo-server/22416
[3]: #2006

cc @martijnwalraven
  • Loading branch information
abernix committed Dec 13, 2018
1 parent 71dff3e commit 34322a6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ export function testApolloServer<AS extends ApolloServerBase>(
});
});
});
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"
Expand Down Expand Up @@ -1025,7 +1025,7 @@ export function testApolloServer<AS extends ApolloServerBase>(
}

const client = new SubscriptionClient(
`ws://localhost:${port}${server.subscriptionsPath}`,
`ws://localhost:${port}${server.subscriptionsPath || ''}`,
{},
WebSocket,
);
Expand Down

0 comments on commit 34322a6

Please sign in to comment.