@@ -1777,7 +1777,7 @@ describe('ReactHooksWithNoopRenderer', () => {
17771777 } , [ props . count ] ) ;
17781778 return < Text text = { 'Count: ' + count } /> ;
17791779 }
1780- expect ( ( ) =>
1780+ expect ( ( ) => {
17811781 act ( ( ) => {
17821782 ReactNoop . render ( < Counter count = { 0 } /> , ( ) =>
17831783 Scheduler . unstable_yieldValue ( 'Sync effect' ) ,
@@ -1787,8 +1787,8 @@ describe('ReactHooksWithNoopRenderer', () => {
17871787 'Sync effect' ,
17881788 ] ) ;
17891789 expect ( ReactNoop . getChildren ( ) ) . toEqual ( [ span ( 'Count: (empty)' ) ] ) ;
1790- } ) ,
1791- ) . toErrorDev ( 'flushSync was called from inside a lifecycle method' ) ;
1790+ } ) ;
1791+ } ) . toErrorDev ( 'flushSync was called from inside a lifecycle method' ) ;
17921792 expect ( ReactNoop . getChildren ( ) ) . toEqual ( [ span ( 'Count: 0' ) ] ) ;
17931793 } ) ;
17941794
@@ -2648,32 +2648,32 @@ describe('ReactHooksWithNoopRenderer', () => {
26482648 }
26492649
26502650 const root1 = ReactNoop . createRoot ( ) ;
2651- expect ( ( ) =>
2651+ expect ( ( ) => {
26522652 act ( ( ) => {
26532653 root1 . render ( < App return = { 17 } /> ) ;
2654- } ) ,
2655- ) . toErrorDev ( [
2654+ } ) ;
2655+ } ) . toErrorDev ( [
26562656 'Warning: useEffect must not return anything besides a ' +
26572657 'function, which is used for clean-up. You returned: 17' ,
26582658 ] ) ;
26592659
26602660 const root2 = ReactNoop . createRoot ( ) ;
2661- expect ( ( ) =>
2661+ expect ( ( ) => {
26622662 act ( ( ) => {
26632663 root2 . render ( < App return = { null } /> ) ;
2664- } ) ,
2665- ) . toErrorDev ( [
2664+ } ) ;
2665+ } ) . toErrorDev ( [
26662666 'Warning: useEffect must not return anything besides a ' +
26672667 'function, which is used for clean-up. You returned null. If your ' +
26682668 'effect does not require clean up, return undefined (or nothing).' ,
26692669 ] ) ;
26702670
26712671 const root3 = ReactNoop . createRoot ( ) ;
2672- expect ( ( ) =>
2672+ expect ( ( ) => {
26732673 act ( ( ) => {
26742674 root3 . render ( < App return = { Promise . resolve ( ) } /> ) ;
2675- } ) ,
2676- ) . toErrorDev ( [
2675+ } ) ;
2676+ } ) . toErrorDev ( [
26772677 'Warning: useEffect must not return anything besides a ' +
26782678 'function, which is used for clean-up.\n\n' +
26792679 'It looks like you wrote useEffect(async () => ...) or returned a Promise.' ,
@@ -3052,32 +3052,32 @@ describe('ReactHooksWithNoopRenderer', () => {
30523052 }
30533053
30543054 const root1 = ReactNoop . createRoot ( ) ;
3055- expect ( ( ) =>
3055+ expect ( ( ) => {
30563056 act ( ( ) => {
30573057 root1 . render ( < App return = { 17 } /> ) ;
3058- } ) ,
3059- ) . toErrorDev ( [
3058+ } ) ;
3059+ } ) . toErrorDev ( [
30603060 'Warning: useInsertionEffect must not return anything besides a ' +
30613061 'function, which is used for clean-up. You returned: 17' ,
30623062 ] ) ;
30633063
30643064 const root2 = ReactNoop . createRoot ( ) ;
3065- expect ( ( ) =>
3065+ expect ( ( ) => {
30663066 act ( ( ) => {
30673067 root2 . render ( < App return = { null } /> ) ;
3068- } ) ,
3069- ) . toErrorDev ( [
3068+ } ) ;
3069+ } ) . toErrorDev ( [
30703070 'Warning: useInsertionEffect must not return anything besides a ' +
30713071 'function, which is used for clean-up. You returned null. If your ' +
30723072 'effect does not require clean up, return undefined (or nothing).' ,
30733073 ] ) ;
30743074
30753075 const root3 = ReactNoop . createRoot ( ) ;
3076- expect ( ( ) =>
3076+ expect ( ( ) => {
30773077 act ( ( ) => {
30783078 root3 . render ( < App return = { Promise . resolve ( ) } /> ) ;
3079- } ) ,
3080- ) . toErrorDev ( [
3079+ } ) ;
3080+ } ) . toErrorDev ( [
30813081 'Warning: useInsertionEffect must not return anything besides a ' +
30823082 'function, which is used for clean-up.\n\n' +
30833083 'It looks like you wrote useInsertionEffect(async () => ...) or returned a Promise.' ,
@@ -3104,11 +3104,11 @@ describe('ReactHooksWithNoopRenderer', () => {
31043104 }
31053105
31063106 const root = ReactNoop . createRoot ( ) ;
3107- expect ( ( ) =>
3107+ expect ( ( ) => {
31083108 act ( ( ) => {
31093109 root . render ( < App /> ) ;
3110- } ) ,
3111- ) . toErrorDev ( [ 'Warning: useInsertionEffect must not schedule updates.' ] ) ;
3110+ } ) ;
3111+ } ) . toErrorDev ( [ 'Warning: useInsertionEffect must not schedule updates.' ] ) ;
31123112
31133113 expect ( ( ) => {
31143114 act ( ( ) => {
@@ -3359,32 +3359,32 @@ describe('ReactHooksWithNoopRenderer', () => {
33593359 }
33603360
33613361 const root1 = ReactNoop . createRoot ( ) ;
3362- expect ( ( ) =>
3362+ expect ( ( ) => {
33633363 act ( ( ) => {
33643364 root1 . render ( < App return = { 17 } /> ) ;
3365- } ) ,
3366- ) . toErrorDev ( [
3365+ } ) ;
3366+ } ) . toErrorDev ( [
33673367 'Warning: useLayoutEffect must not return anything besides a ' +
33683368 'function, which is used for clean-up. You returned: 17' ,
33693369 ] ) ;
33703370
33713371 const root2 = ReactNoop . createRoot ( ) ;
3372- expect ( ( ) =>
3372+ expect ( ( ) => {
33733373 act ( ( ) => {
33743374 root2 . render ( < App return = { null } /> ) ;
3375- } ) ,
3376- ) . toErrorDev ( [
3375+ } ) ;
3376+ } ) . toErrorDev ( [
33773377 'Warning: useLayoutEffect must not return anything besides a ' +
33783378 'function, which is used for clean-up. You returned null. If your ' +
33793379 'effect does not require clean up, return undefined (or nothing).' ,
33803380 ] ) ;
33813381
33823382 const root3 = ReactNoop . createRoot ( ) ;
3383- expect ( ( ) =>
3383+ expect ( ( ) => {
33843384 act ( ( ) => {
33853385 root3 . render ( < App return = { Promise . resolve ( ) } /> ) ;
3386- } ) ,
3387- ) . toErrorDev ( [
3386+ } ) ;
3387+ } ) . toErrorDev ( [
33883388 'Warning: useLayoutEffect must not return anything besides a ' +
33893389 'function, which is used for clean-up.\n\n' +
33903390 'It looks like you wrote useLayoutEffect(async () => ...) or returned a Promise.' ,
0 commit comments