Skip to content

feat: support for react suspense #1788

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

Merged
merged 30 commits into from
Aug 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
463253d
chore: support for react suspense
mdjastrzebski Jul 14, 2025
718aaae
basic impl
mdjastrzebski Jul 14, 2025
ea48684
.
mdjastrzebski Jul 14, 2025
0441c84
.
mdjastrzebski Jul 14, 2025
06ed368
fake timers
mdjastrzebski Jul 16, 2025
3f774b2
update user event
mdjastrzebski Jul 21, 2025
24db2aa
async fireEvent; async screen methods
mdjastrzebski Jul 21, 2025
e83d06b
fix lint
mdjastrzebski Jul 21, 2025
5a28078
.
mdjastrzebski Jul 21, 2025
9a2592e
fix async timers
mdjastrzebski Aug 4, 2025
78150f6
fix tests
mdjastrzebski Aug 4, 2025
4c0f1f5
improve test coverage
mdjastrzebski Aug 4, 2025
e4b4bea
throw on using incorrect `update`/`unmount` function
mdjastrzebski Aug 5, 2025
6aa1741
update docs
mdjastrzebski Aug 5, 2025
7842092
ensure `rerenderAsync` and `unmountAsync` called after `renderAsync`
mdjastrzebski Aug 5, 2025
1aef26b
fix issues
mdjastrzebski Aug 5, 2025
06591f3
fix lint
mdjastrzebski Aug 5, 2025
3121bd8
suspense tests 1
mdjastrzebski Aug 6, 2025
45e7e0e
suspense test 2
mdjastrzebski Aug 6, 2025
b9dfb88
suspense tests 3
mdjastrzebski Aug 6, 2025
c6e46a1
suspense test 4
mdjastrzebski Aug 6, 2025
00c2769
fix tests
mdjastrzebski Aug 6, 2025
2c649a5
fix lint
mdjastrzebski Aug 7, 2025
d240675
improve error stack traces
mdjastrzebski Aug 7, 2025
9f7b04b
fix lint
mdjastrzebski Aug 7, 2025
89dc7fe
cleanup
mdjastrzebski Aug 7, 2025
703c610
.
mdjastrzebski Aug 7, 2025
e9ff87e
tweak code cov
mdjastrzebski Aug 7, 2025
d97cab0
tweaks
mdjastrzebski Aug 7, 2025
9c714c0
self code review
mdjastrzebski Aug 7, 2025
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cSpell.words": [
"labelledby",
"Pressability",
"Pressable",
"redent",
"RNTL",
Expand Down
8 changes: 7 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
module.exports = {
preset: 'react-native',
setupFilesAfterEnv: ['./jest-setup.ts'],
testPathIgnorePatterns: ['build/', 'examples/', 'experiments-app/', 'timer-utils'],
testPathIgnorePatterns: ['build/', 'examples/', 'experiments-app/'],
testTimeout: 60000,
transformIgnorePatterns: [
'/node_modules/(?!(@react-native|react-native|react-native-gesture-handler)/).*/',
],
snapshotSerializers: ['@relmify/jest-serializer-strip-ansi/always'],
clearMocks: true,
collectCoverageFrom: [
"src/**/*.{js,jsx,ts,tsx}",
"!src/**/__tests__/**",
"!src/**/*.test.js",
"!src/test-utils/**", // Exclude setup files
],
};
4 changes: 2 additions & 2 deletions src/__tests__/act.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ test('render should trigger useEffect', () => {
expect(effectCallback).toHaveBeenCalledTimes(1);
});

test('update should trigger useEffect', () => {
test('rerender should trigger useEffect', () => {
const effectCallback = jest.fn();
render(<UseEffect callback={effectCallback} />);
screen.update(<UseEffect callback={effectCallback} />);
screen.rerender(<UseEffect callback={effectCallback} />);

expect(effectCallback).toHaveBeenCalledTimes(2);
});
Expand Down
Loading