Skip to content
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

Fix tests affected by change to cache #12330

Merged
merged 4 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .api-reports/api-report-testing_react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -252,10 +249,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
1 change: 1 addition & 0 deletions knip.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const config = {
],
ignoreBinaries: ["jq"],
ignoreDependencies: [
/@actions\/.*/,
/@size-limit\/.*/,
/eslint-.*/,
// used by `recast`
Expand Down
2 changes: 1 addition & 1 deletion src/core/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ interface MaskOperationOptions<TData> {
fetchPolicy?: WatchQueryFetchPolicy;
}

export interface QueryManagerOptions<TStore> {
interface QueryManagerOptions<TStore> {
cache: ApolloCache<TStore>;
link: ApolloLink;
defaultOptions: DefaultOptions;
Expand Down
17 changes: 8 additions & 9 deletions src/core/__tests__/ObservableQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,7 @@ describe("ObservableQuery", () => {
await observable.refetch(variables2);

await expect(stream).toEmitApolloQueryResult({
// TODO: Ensure this value is undefined instead of an empty object
data: {},
data: undefined,
loading: true,
networkStatus: NetworkStatus.setVariables,
partial: true,
Expand Down Expand Up @@ -404,7 +403,7 @@ describe("ObservableQuery", () => {
});

await expect(stream).toEmitApolloQueryResult({
data: {},
data: undefined,
loading: true,
networkStatus: NetworkStatus.setVariables,
partial: true,
Expand Down Expand Up @@ -561,7 +560,7 @@ describe("ObservableQuery", () => {
await client.resetStore();

await expect(stream).toEmitApolloQueryResult({
data: {},
data: undefined,
loading: false,
networkStatus: NetworkStatus.ready,
partial: true,
Expand Down Expand Up @@ -825,7 +824,7 @@ describe("ObservableQuery", () => {
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
data: {},
data: undefined,
loading: true,
networkStatus: NetworkStatus.setVariables,
partial: true,
Expand Down Expand Up @@ -1069,7 +1068,7 @@ describe("ObservableQuery", () => {
await expect(stream).toEmitApolloQueryResult({
// TODO: Fix this error
// @ts-expect-error Ensure ApolloQueryResult allows for undefined and fix this value to match
data: {},
data: undefined,
loading: true,
networkStatus: NetworkStatus.setVariables,
partial: true,
Expand Down Expand Up @@ -1120,7 +1119,7 @@ describe("ObservableQuery", () => {
await expect(stream).toEmitApolloQueryResult({
// TODO: Fix this error
// @ts-expect-error Need to update ApolloQueryResult to allow undefined and fix this value
data: {},
data: undefined,
loading: true,
networkStatus: NetworkStatus.setVariables,
partial: true,
Expand Down Expand Up @@ -1452,7 +1451,7 @@ describe("ObservableQuery", () => {
await observable.refetch(variables2);

await expect(stream).toEmitApolloQueryResult({
data: {},
data: undefined,
loading: true,
networkStatus: NetworkStatus.setVariables,
partial: true,
Expand Down Expand Up @@ -1566,7 +1565,7 @@ describe("ObservableQuery", () => {
await observable.refetch(variables2);

await expect(stream).toEmitApolloQueryResult({
data: {},
data: undefined,
loading: true,
networkStatus: NetworkStatus.setVariables,
partial: true,
Expand Down