Skip to content

Commit

Permalink
chore(deps): update dependency @changesets/read to ^0.6.2 (#2055)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency @changesets/read to ^0.6.2

* fix(ci): flaky tests

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vicary A <[email protected]>
  • Loading branch information
renovate[bot] and vicary authored Feb 3, 2025
1 parent 2bf7bf5 commit b28eaaa
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 114 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.12",
"@changesets/config": "^3.0.5",
"@changesets/read": "^0.6.1",
"@changesets/read": "^0.6.2",
"@types/node": "^20.16.5",
"bob-esbuild": "^4.0.3",
"bob-esbuild-cli": "^4.0.0",
Expand All @@ -34,7 +34,7 @@
"changesets-github-release": "^0.1.0",
"concurrently": "^8.2.2",
"esbuild": "^0.23.1",
"globby": "^14.0.2",
"fast-glob": "^3.3.2",
"husky": "^9.1.7",
"jest": "^29.7.0",
"open": "^10.1.0",
Expand Down
36 changes: 22 additions & 14 deletions packages/react/test/useMutation.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { renderHook, waitFor } from '@testing-library/react';
import { Cache } from 'gqty';
import { act } from 'react';
import { createReactTestClient } from './utils';

Expand Down Expand Up @@ -65,7 +66,17 @@ describe('useMutation', () => {
});

it('should update contents of useQuery via normalized cache', async () => {
const { useQuery, useMutation } = await createReactTestClient();
const { useQuery, useMutation } = await createReactTestClient(
undefined,
undefined,
undefined,
{
cache: new Cache(undefined, {
maxAge: Infinity,
normalization: true,
}),
}
);
const { result: q } = renderHook(() => {
const human = useQuery().human({ name: 'Uno' });

Expand All @@ -88,20 +99,17 @@ describe('useMutation', () => {
);
});

await waitFor(() => expect(q.current.name).toStrictEqual('Uno'));

await act(() => m.current[0]({ args: { name: 'Uno', newName: 'Dos' } }));
const waitForName = (name: string) =>
waitFor(() => expect(q.current.name).toStrictEqual(name));

await waitFor(() => expect(q.current.name).toStrictEqual('Dos'));

await act(() => m.current[0]({ args: { name: 'Dos', newName: 'Tres' } }));

await waitFor(() => expect(q.current.name).toStrictEqual('Tres'));

await act(() =>
m.current[0]({ args: { name: 'Tres', newName: 'Cuatro' } })
);
const changeName = async (name: string, newName: string) => {
await act(() => m.current[0]({ args: { name, newName } }));
await waitForName(newName);
};

await waitFor(() => expect(q.current.name).toStrictEqual('Cuatro'));
await waitForName('Uno');
await changeName('Uno', 'Dos');
await changeName('Dos', 'Tres');
await changeName('Tres', 'Cuatro');
});
});
107 changes: 11 additions & 96 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scripts/test-esm.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import chalk from 'chalk';
import { execSync } from 'child_process';
import { globby } from 'globby';
import glob from 'fast-glob';
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';

async function main() {
const cwd = dirname(fileURLToPath(import.meta.url));
const mjsFiles = await globby(['../packages/*/dist/*.mjs'], {
const mjsFiles = await glob(['../packages/*/dist/*.mjs'], {
cwd,
});

Expand Down

0 comments on commit b28eaaa

Please sign in to comment.