react icon indicating copy to clipboard operation
react copied to clipboard

Stop using Scheduler.log to test double invocations

Open eps1lon opened this issue 2 months ago • 1 comments

Stack:

  1. https://github.com/facebook/react/pull/29006
  2. https://github.com/facebook/react/pull/29008 <-- You're here
  3. https://github.com/facebook/react/pull/29007

Summary

In a follow-up, I want to dim console calls for effect invocations due to StrictMode just like we do for render-time invocations due to StrictMode. This will automatically ignore Scheduler.log calls during effect invocations caused by StrictMode (just like it does for render-time invocations due to StrictMode).

That means we have to use other means of testing double invocations during StrictMode. I used the same pattern we used for render-time double invocations: pushing to a log.

Also used the opportunity to reduce the size of some log assertions to make future diffs readable. Git will not be able to correctly identify where a new log lines where added and think they got moved instead.

How did you test this change?

  • [x] Assertions on log are still the same in https://github.com/facebook/react/pull/29007

eps1lon avatar May 06 '24 21:05 eps1lon