Skip to content

Commit 34c2645

Browse files
committed
lint
1 parent 75ec8fb commit 34c2645

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

packages/openapi-react-query/test/index.test.tsx

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,36 +70,41 @@ describe("client", () => {
7070

7171
const initialData = { title: "Initial data", body: "Initial data" };
7272

73-
const options = client.queryOptions("get", "/blogposts/{post_id}", {
74-
params: {
75-
path: {
76-
post_id: "1",
73+
const options = client.queryOptions(
74+
"get",
75+
"/blogposts/{post_id}",
76+
{
77+
params: {
78+
path: {
79+
post_id: "1",
80+
},
7781
},
7882
},
79-
},{
80-
initialData: () => initialData
81-
})
83+
{
84+
initialData: () => initialData,
85+
},
86+
);
8287

83-
const data = queryClient.getQueryData( options.queryKey );
84-
85-
expectTypeOf(data).toEqualTypeOf<{
86-
title: string;
87-
body: string;
88-
publish_date?: number;
89-
} | undefined>();
88+
const data = queryClient.getQueryData(options.queryKey);
89+
90+
expectTypeOf(data).toEqualTypeOf<
91+
| {
92+
title: string;
93+
body: string;
94+
publish_date?: number;
95+
}
96+
| undefined
97+
>();
9098
expect(data).toEqual(undefined);
9199

92-
const { result } = renderHook(() => useQuery({...options, enabled: false}), {
100+
const { result } = renderHook(() => useQuery({ ...options, enabled: false }), {
93101
wrapper,
94102
});
95103

96104
await waitFor(() => expect(result.current.isFetching).toBe(false));
97105

98106
expect(result.current.data).toEqual(initialData);
99107
expect(result.current.error).toBeNull();
100-
101-
102-
103108
});
104109

105110
it("returns query options that can resolve data correctly with fetchQuery", async () => {

0 commit comments

Comments
 (0)