Skip to content

Commit 56fecdd

Browse files
committed
style: format with oxfmt
1 parent fe975c8 commit 56fecdd

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
import { describe, it } from "vitest";
2-
import { createQuery } from "query:index";
3-
import { act, Suspense } from "react";
4-
import { createRoot } from "react-dom/client";
5-
import { ErrNoQueryInstanceFound, useQueryInstance } from "./useQueryInstance";
6-
7-
describe("useQueryInstance", function () {
8-
it("can get a query instance", async ({ expect }) => {
1+
import { describe, it } from 'vitest'
2+
import { createQuery } from 'query:index'
3+
import { act, Suspense } from 'react'
4+
import { createRoot } from 'react-dom/client'
5+
import { ErrNoQueryInstanceFound, useQueryInstance } from './useQueryInstance'
6+
7+
describe('useQueryInstance', function () {
8+
it('can get a query instance', async ({ expect }) => {
99
function fetcher(key: string) {
10-
return Promise.resolve(key);
10+
return Promise.resolve(key)
1111
}
1212

13-
const query = createQuery({ fetcher });
14-
const options = { query };
15-
let queryFromHook: unknown = null;
13+
const query = createQuery({ fetcher })
14+
const options = { query }
15+
let queryFromHook: unknown = null
1616

1717
function Component() {
18-
queryFromHook = useQueryInstance(options);
19-
return null;
18+
queryFromHook = useQueryInstance(options)
19+
return null
2020
}
2121

22-
const container = document.createElement("div");
22+
const container = document.createElement('div')
2323

2424
// oxlint-disable-next-line
2525
await act(async function () {
2626
createRoot(container).render(
2727
<Suspense fallback="loading">
2828
<Component />
29-
</Suspense>,
30-
);
31-
});
29+
</Suspense>
30+
)
31+
})
3232

33-
expect(queryFromHook).not.toBeNull();
34-
});
33+
expect(queryFromHook).not.toBeNull()
34+
})
3535

36-
it("throws if no query instance is found", async ({ expect }) => {
37-
let caughtError: Error | undefined = undefined;
36+
it('throws if no query instance is found', async ({ expect }) => {
37+
let caughtError: Error | undefined = undefined
3838

3939
function Component() {
4040
try {
41-
useQueryInstance();
41+
useQueryInstance()
4242
} catch (e) {
43-
caughtError = e as Error;
43+
caughtError = e as Error
4444
}
45-
return null;
45+
return null
4646
}
4747

48-
const container = document.createElement("div");
48+
const container = document.createElement('div')
4949

5050
// oxlint-disable-next-line
5151
await act(async function () {
5252
createRoot(container).render(
5353
<Suspense fallback="loading">
5454
<Component />
55-
</Suspense>,
56-
);
57-
});
55+
</Suspense>
56+
)
57+
})
5858

59-
expect(caughtError).toBe(ErrNoQueryInstanceFound);
60-
});
61-
});
59+
expect(caughtError).toBe(ErrNoQueryInstanceFound)
60+
})
61+
})

0 commit comments

Comments
 (0)