-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.14.0: apollo-server-testing createTestingClient broken #4170
Comments
I've noticed exactly the same issue. |
Thanks for reporting this!
|
abernix
added
🥀 needs-reproduction
Lacks a runnable reproduction which can be used to quickly demonstrate a bug.
🛸 needs-more-information
This is at risk of being closed if sufficient details can't be provided.
🪲 bug
labels
May 28, 2020
abernix
removed
🥀 needs-reproduction
Lacks a runnable reproduction which can be used to quickly demonstrate a bug.
🛸 needs-more-information
This is at risk of being closed if sufficient details can't be provided.
labels
May 28, 2020
abernix
added a commit
that referenced
this issue
May 28, 2020
The `apollo-server-testing` package uses an internal Apollo Server method called `executeOperation` (introduced in [#1909]) in order to power its `createTestClient` functionality. This is the testing practice which is documented within [Integration testing] in the Apollo Server documentation. However, it failed to introduce the same context-cloning which [takes place in `runHttpQuery`][Ref 1], prior to arriving at the main request pipeline. Since the context was not cloned, and we had made the expectation in [#3988] that it was a unique context on every single request (which it was, in a non-testing context), the Symbol we use to implement `willResolveField` was already present [on the request pipeline][Ref 2] when running a subsequent test via `createTestClient`! This commit introduces the same cloning that takes place in `buildRequestContext` within `runHttpQuery`, and adds tests to ensure the behavior is preserved. [Fixes #4170]: #4170 [#1909]: #1909 [Integration testing]: https://www.apollographql.com/docs/apollo-server/testing/testing/ [Ref 1]: https://git.io/Jfou6 [#3988]: #3988 [Ref 2]: https://git.io/Jfouy
abernix
changed the title
apollo-server 2.14.0 is breaking tests
2.14.0: apollo-server-testing createTestingClient broken
May 28, 2020
Merged
Hopefully fixed in 2.14.1 via 79c0025. Please report back if it's still problematic! |
@abernix - I can confirm it works for me. |
This was referenced Jun 6, 2020
This was referenced Mar 12, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am sorry for not deep diving into this any further, but this is more of a pre warning (as the version was released few hours ago).
Running tests with apollo-server and apollo-server-testing at 2.14 results this error:
TypeError: Cannot redefine property: Symbol(apolloServerExecutionDispatcherWillResolveField)
at Function.defineProperty ()
Downgrading to 2.13.1 restores to working.
This bug report should include:
Please make a GitHub repository that anyone can clone and run and see the
problem. Other great ways to demonstrate a reproduction are using our
CodeSandbox template (https://codesandbox.io/s/apollo-server), or re-mixing
our Glitch template (https://glitch.com/~apollo-launchpad).
-->
The text was updated successfully, but these errors were encountered: