GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [tests] assertLog before act in useEffectEvent (#28763) · react/react-native@2243b40

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-reconciler/src/__tests__
    • useEffectEvent-test.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/__tests__/useEffectEvent-test.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/__tests__/useEffectEvent-test.js
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ describe('useEffectEvent', () => {
742742
await act(() =>
743743
ReactNoop.render(<ChatRoom roomId="general" theme="light" />),
744744
);
745-
await act(() => jest.runAllTimers());
745+
746746
assertLog(['Welcome to the general room!', 'Connected! theme: light']);
747747
expect(ReactNoop).toMatchRenderedOutput(
748748
<span prop="Welcome to the general room!" />,
@@ -752,20 +752,17 @@ describe('useEffectEvent', () => {
752752
await act(() =>
753753
ReactNoop.render(<ChatRoom roomId="music" theme="light" />),
754754
);
755-
await act(() => jest.runAllTimers());
756755
assertLog([
757756
'Welcome to the music room!',
758757
// should trigger a reconnect
759758
'Connected! theme: light',
760759
]);
761-
762760
expect(ReactNoop).toMatchRenderedOutput(
763761
<span prop="Welcome to the music room!" />,
764762
);
765763

766764
// change theme only
767765
await act(() => ReactNoop.render(<ChatRoom roomId="music" theme="dark" />));
768-
await act(() => jest.runAllTimers());
769766
// should not trigger a reconnect
770767
assertLog(['Welcome to the music room!']);
771768
expect(ReactNoop).toMatchRenderedOutput(
@@ -776,7 +773,6 @@ describe('useEffectEvent', () => {
776773
await act(() =>
777774
ReactNoop.render(<ChatRoom roomId="travel" theme="dark" />),
778775
);
779-
await act(() => jest.runAllTimers());
780776
assertLog([
781777
'Welcome to the travel room!',
782778
// should trigger a reconnect

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.