-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Refactor remaining tests that instantiate QueryManager
directly and remove mockQueryManager
helper
#12327
Conversation
|
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 8c21210bcdb72a675c871898 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are no longer needed since the tests that compared against these snapshots now check against an ApolloError
instance directly.
commit: |
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
size-limit report 📦
|
const { data, loading } = await stream.takeNext(); | ||
await expect(stream).toEmitApolloQueryResult({ | ||
// TODO: Ensure this value is undefined instead of an empty object | ||
data: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once these tests are pulled in the v4 branch, these should be fixed by the updated behavior of cache.diff
.
const result = await stream.takeNext(); | ||
await expect(stream).toEmitApolloQueryResult({ | ||
// TODO: Fix this error | ||
// @ts-expect-error `ApolloQueryResult` needs to be updated to allow for `undefined` and this value needs to emit undefined instead of empty object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This refactor exposed several issues with the values we emit at runtime vs the ApolloQueryResult
type. This is something that will be addressed in v4.
Refactors the remaining tests that instantiated a
QueryManager
instance directly to instantiate anApolloClient
instance instead. This makes our tests resemble more of the end-user experience. As a result, themockQueryManager
andmockWatchQuery
helpers were removed as they are no longer used.This PR also updates as many matchers as possible to use
to*ApolloQueryResult
to ensure results match the expected values. This revealed several issues with our existing values emitted from the core API that don't match our TypeScript types. This will be corrected in the v4 release.