dillon1000/react
Commit
Browse files Convert class equivlance tests to flushSync (#26333)
There's an old collection of test suites that test class component behavior across ES6 (regular JavaScript classes), CoffeeScript classes, and TypeScript classes. They work by running the same tests in all environments and comparing the results. Rather than use `act` or `waitFor` in these, I've changed them to use `flushSync` instead so that they can flush synchronously. The reason is that CoffeeScript doesn't have async/await, so we'd have to write those tests differently than how they are written in the corresponding modules. Since none of these tests cover any concurrent behavior, I believe it's fine in this case to do everything synchronously; they don't use any concurrent features, anyway, so effectively it's just skipping a microtask.
Changed paths4 files
First-parent comparisonpackages/react/src/__tests__/ReactCoffeeScriptClass-test.coffee ModifiedM packages/react/src/__tests__/ReactES6Class-test.js ModifiedM packages/react/src/__tests__/ReactTypeScriptClass-test.ts ModifiedM packages/react/src/__tests__/testDefinitions/ReactDOM.d.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…