Skip to content

Commit

Permalink
fix(package/solid): flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vicary committed Jan 31, 2025
1 parent ecb06a8 commit 8afcf2c
Show file tree
Hide file tree
Showing 3 changed files with 502 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"[javascript][typescript]": {
"[javascript][typescript][typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "node_modules/typescript/lib",
Expand Down
10 changes: 5 additions & 5 deletions packages/solid/src/query.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('createQuery', () => {
const { createQuery } = await createMockSolidClient({
client: {
cache: new Cache(undefined, {
maxAge: 0,
maxAge: 100,
staleWhileRevalidate: 5 * 30 * 1000,
}),
onFetch: ({ query }) => {
Expand Down Expand Up @@ -314,7 +314,7 @@ describe('createQuery', () => {
consoleMock.mockRestore();
});

it('should stay reactive for mutations', async () => {
it('should stay reactive for mutations', { timeout: 60_000 }, async () => {
const cache = new Cache(undefined, {
normalization: true,
});
Expand Down Expand Up @@ -350,7 +350,7 @@ describe('createQuery', () => {

await user.click(getByText('Fido'));

await waitFor(() => getByText('Rex'));
await waitFor(() => getByText('Rex'), { timeout: 60_000 });
});

it('should refetch on reconnect', async () => {
Expand All @@ -366,7 +366,7 @@ describe('createQuery', () => {
const { createQuery } = await createMockSolidClient({
client: {
cache: new Cache(undefined, {
maxAge: 0,
maxAge: 100,
staleWhileRevalidate: 5 * 30 * 1000,
}),
},
Expand Down Expand Up @@ -430,7 +430,7 @@ describe('createQuery', () => {
const { createQuery } = await createMockSolidClient({
client: {
cache: new Cache(undefined, {
maxAge: 0,
maxAge: 100,
staleWhileRevalidate: 5 * 30 * 1000,
}),
},
Expand Down
Loading

0 comments on commit 8afcf2c

Please sign in to comment.